imate C++/CUDA Reference
py_c_matrix.cpp
Go to the documentation of this file.
1 /* Generated by Cython 0.29.24 */
2 
3 /* BEGIN: Cython Metadata
4 {
5  "distutils": {
6  "define_macros": [
7  [
8  "NPY_NO_DEPRECATED_API",
9  "NPY_1_7_API_VERSION"
10  ]
11  ],
12  "depends": [
13  "imate/_c_linear_operator/c_csc_matrix.h",
14  "imate/_c_linear_operator/c_csr_matrix.h",
15  "imate/_c_linear_operator/c_dense_matrix.h",
16  "imate/_c_linear_operator/c_linear_operator.h",
17  "imate/_c_linear_operator/c_matrix.h"
18  ],
19  "include_dirs": [
20  "./imate/_c_linear_operator",
21  "i",
22  "m",
23  "a",
24  "t",
25  "e",
26  "/",
27  "_",
28  "c",
29  "b",
30  "s",
31  "l",
32  "g",
33  "r"
34  ],
35  "language": "c++",
36  "name": "imate._c_linear_operator.py_c_matrix",
37  "sources": [
38  "./imate/_c_linear_operator/py_c_matrix.pyx",
39  "./imate/_c_linear_operator/c_csc_matrix.cpp",
40  "./imate/_c_linear_operator/c_csr_matrix.cpp",
41  "./imate/_c_linear_operator/c_matrix.cpp",
42  "./imate/_c_linear_operator/c_linear_operator.cpp",
43  "./imate/_c_linear_operator/c_csr_affine_matrix_function.cpp",
44  "./imate/_c_linear_operator/c_csc_affine_matrix_function.cpp",
45  "./imate/_c_linear_operator/c_dense_affine_matrix_function.cpp",
46  "./imate/_c_linear_operator/c_dense_matrix.cpp",
47  "./imate/_c_linear_operator/c_affine_matrix_function.cpp",
48  "imate/_c_basic_algebra/cblas_interface.cpp",
49  "imate/_c_basic_algebra/c_vector_operations.cpp",
50  "imate/_c_basic_algebra/c_matrix_operations.cpp"
51  ]
52  },
53  "module_name": "imate._c_linear_operator.py_c_matrix"
54 }
55 END: Cython Metadata */
56 
57 #ifndef PY_SSIZE_T_CLEAN
58 #define PY_SSIZE_T_CLEAN
59 #endif /* PY_SSIZE_T_CLEAN */
60 #include "Python.h"
61 #ifndef Py_PYTHON_H
62  #error Python headers needed to compile C extensions, please install development version of Python.
63 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
64  #error Cython requires Python 2.6+ or Python 3.3+.
65 #else
66 #define CYTHON_ABI "0_29_24"
67 #define CYTHON_HEX_VERSION 0x001D18F0
68 #define CYTHON_FUTURE_DIVISION 1
69 #include <stddef.h>
70 #ifndef offsetof
71  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
72 #endif
73 #if !defined(WIN32) && !defined(MS_WINDOWS)
74  #ifndef __stdcall
75  #define __stdcall
76  #endif
77  #ifndef __cdecl
78  #define __cdecl
79  #endif
80  #ifndef __fastcall
81  #define __fastcall
82  #endif
83 #endif
84 #ifndef DL_IMPORT
85  #define DL_IMPORT(t) t
86 #endif
87 #ifndef DL_EXPORT
88  #define DL_EXPORT(t) t
89 #endif
90 #define __PYX_COMMA ,
91 #ifndef HAVE_LONG_LONG
92  #if PY_VERSION_HEX >= 0x02070000
93  #define HAVE_LONG_LONG
94  #endif
95 #endif
96 #ifndef PY_LONG_LONG
97  #define PY_LONG_LONG LONG_LONG
98 #endif
99 #ifndef Py_HUGE_VAL
100  #define Py_HUGE_VAL HUGE_VAL
101 #endif
102 #ifdef PYPY_VERSION
103  #define CYTHON_COMPILING_IN_PYPY 1
104  #define CYTHON_COMPILING_IN_PYSTON 0
105  #define CYTHON_COMPILING_IN_CPYTHON 0
106  #undef CYTHON_USE_TYPE_SLOTS
107  #define CYTHON_USE_TYPE_SLOTS 0
108  #undef CYTHON_USE_PYTYPE_LOOKUP
109  #define CYTHON_USE_PYTYPE_LOOKUP 0
110  #if PY_VERSION_HEX < 0x03050000
111  #undef CYTHON_USE_ASYNC_SLOTS
112  #define CYTHON_USE_ASYNC_SLOTS 0
113  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
114  #define CYTHON_USE_ASYNC_SLOTS 1
115  #endif
116  #undef CYTHON_USE_PYLIST_INTERNALS
117  #define CYTHON_USE_PYLIST_INTERNALS 0
118  #undef CYTHON_USE_UNICODE_INTERNALS
119  #define CYTHON_USE_UNICODE_INTERNALS 0
120  #undef CYTHON_USE_UNICODE_WRITER
121  #define CYTHON_USE_UNICODE_WRITER 0
122  #undef CYTHON_USE_PYLONG_INTERNALS
123  #define CYTHON_USE_PYLONG_INTERNALS 0
124  #undef CYTHON_AVOID_BORROWED_REFS
125  #define CYTHON_AVOID_BORROWED_REFS 1
126  #undef CYTHON_ASSUME_SAFE_MACROS
127  #define CYTHON_ASSUME_SAFE_MACROS 0
128  #undef CYTHON_UNPACK_METHODS
129  #define CYTHON_UNPACK_METHODS 0
130  #undef CYTHON_FAST_THREAD_STATE
131  #define CYTHON_FAST_THREAD_STATE 0
132  #undef CYTHON_FAST_PYCALL
133  #define CYTHON_FAST_PYCALL 0
134  #undef CYTHON_PEP489_MULTI_PHASE_INIT
135  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
136  #undef CYTHON_USE_TP_FINALIZE
137  #define CYTHON_USE_TP_FINALIZE 0
138  #undef CYTHON_USE_DICT_VERSIONS
139  #define CYTHON_USE_DICT_VERSIONS 0
140  #undef CYTHON_USE_EXC_INFO_STACK
141  #define CYTHON_USE_EXC_INFO_STACK 0
142 #elif defined(PYSTON_VERSION)
143  #define CYTHON_COMPILING_IN_PYPY 0
144  #define CYTHON_COMPILING_IN_PYSTON 1
145  #define CYTHON_COMPILING_IN_CPYTHON 0
146  #ifndef CYTHON_USE_TYPE_SLOTS
147  #define CYTHON_USE_TYPE_SLOTS 1
148  #endif
149  #undef CYTHON_USE_PYTYPE_LOOKUP
150  #define CYTHON_USE_PYTYPE_LOOKUP 0
151  #undef CYTHON_USE_ASYNC_SLOTS
152  #define CYTHON_USE_ASYNC_SLOTS 0
153  #undef CYTHON_USE_PYLIST_INTERNALS
154  #define CYTHON_USE_PYLIST_INTERNALS 0
155  #ifndef CYTHON_USE_UNICODE_INTERNALS
156  #define CYTHON_USE_UNICODE_INTERNALS 1
157  #endif
158  #undef CYTHON_USE_UNICODE_WRITER
159  #define CYTHON_USE_UNICODE_WRITER 0
160  #undef CYTHON_USE_PYLONG_INTERNALS
161  #define CYTHON_USE_PYLONG_INTERNALS 0
162  #ifndef CYTHON_AVOID_BORROWED_REFS
163  #define CYTHON_AVOID_BORROWED_REFS 0
164  #endif
165  #ifndef CYTHON_ASSUME_SAFE_MACROS
166  #define CYTHON_ASSUME_SAFE_MACROS 1
167  #endif
168  #ifndef CYTHON_UNPACK_METHODS
169  #define CYTHON_UNPACK_METHODS 1
170  #endif
171  #undef CYTHON_FAST_THREAD_STATE
172  #define CYTHON_FAST_THREAD_STATE 0
173  #undef CYTHON_FAST_PYCALL
174  #define CYTHON_FAST_PYCALL 0
175  #undef CYTHON_PEP489_MULTI_PHASE_INIT
176  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
177  #undef CYTHON_USE_TP_FINALIZE
178  #define CYTHON_USE_TP_FINALIZE 0
179  #undef CYTHON_USE_DICT_VERSIONS
180  #define CYTHON_USE_DICT_VERSIONS 0
181  #undef CYTHON_USE_EXC_INFO_STACK
182  #define CYTHON_USE_EXC_INFO_STACK 0
183 #else
184  #define CYTHON_COMPILING_IN_PYPY 0
185  #define CYTHON_COMPILING_IN_PYSTON 0
186  #define CYTHON_COMPILING_IN_CPYTHON 1
187  #ifndef CYTHON_USE_TYPE_SLOTS
188  #define CYTHON_USE_TYPE_SLOTS 1
189  #endif
190  #if PY_VERSION_HEX < 0x02070000
191  #undef CYTHON_USE_PYTYPE_LOOKUP
192  #define CYTHON_USE_PYTYPE_LOOKUP 0
193  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
194  #define CYTHON_USE_PYTYPE_LOOKUP 1
195  #endif
196  #if PY_MAJOR_VERSION < 3
197  #undef CYTHON_USE_ASYNC_SLOTS
198  #define CYTHON_USE_ASYNC_SLOTS 0
199  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
200  #define CYTHON_USE_ASYNC_SLOTS 1
201  #endif
202  #if PY_VERSION_HEX < 0x02070000
203  #undef CYTHON_USE_PYLONG_INTERNALS
204  #define CYTHON_USE_PYLONG_INTERNALS 0
205  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
206  #define CYTHON_USE_PYLONG_INTERNALS 1
207  #endif
208  #ifndef CYTHON_USE_PYLIST_INTERNALS
209  #define CYTHON_USE_PYLIST_INTERNALS 1
210  #endif
211  #ifndef CYTHON_USE_UNICODE_INTERNALS
212  #define CYTHON_USE_UNICODE_INTERNALS 1
213  #endif
214  #if PY_VERSION_HEX < 0x030300F0
215  #undef CYTHON_USE_UNICODE_WRITER
216  #define CYTHON_USE_UNICODE_WRITER 0
217  #elif !defined(CYTHON_USE_UNICODE_WRITER)
218  #define CYTHON_USE_UNICODE_WRITER 1
219  #endif
220  #ifndef CYTHON_AVOID_BORROWED_REFS
221  #define CYTHON_AVOID_BORROWED_REFS 0
222  #endif
223  #ifndef CYTHON_ASSUME_SAFE_MACROS
224  #define CYTHON_ASSUME_SAFE_MACROS 1
225  #endif
226  #ifndef CYTHON_UNPACK_METHODS
227  #define CYTHON_UNPACK_METHODS 1
228  #endif
229  #ifndef CYTHON_FAST_THREAD_STATE
230  #define CYTHON_FAST_THREAD_STATE 1
231  #endif
232  #ifndef CYTHON_FAST_PYCALL
233  #define CYTHON_FAST_PYCALL 1
234  #endif
235  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
236  #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
237  #endif
238  #ifndef CYTHON_USE_TP_FINALIZE
239  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
240  #endif
241  #ifndef CYTHON_USE_DICT_VERSIONS
242  #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
243  #endif
244  #ifndef CYTHON_USE_EXC_INFO_STACK
245  #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
246  #endif
247 #endif
248 #if !defined(CYTHON_FAST_PYCCALL)
249 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
250 #endif
251 #if CYTHON_USE_PYLONG_INTERNALS
252  #include "longintrepr.h"
253  #undef SHIFT
254  #undef BASE
255  #undef MASK
256  #ifdef SIZEOF_VOID_P
257  enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
258  #endif
259 #endif
260 #ifndef __has_attribute
261  #define __has_attribute(x) 0
262 #endif
263 #ifndef __has_cpp_attribute
264  #define __has_cpp_attribute(x) 0
265 #endif
266 #ifndef CYTHON_RESTRICT
267  #if defined(__GNUC__)
268  #define CYTHON_RESTRICT __restrict__
269  #elif defined(_MSC_VER) && _MSC_VER >= 1400
270  #define CYTHON_RESTRICT __restrict
271  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
272  #define CYTHON_RESTRICT restrict
273  #else
274  #define CYTHON_RESTRICT
275  #endif
276 #endif
277 #ifndef CYTHON_UNUSED
278 # if defined(__GNUC__)
279 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
280 # define CYTHON_UNUSED __attribute__ ((__unused__))
281 # else
282 # define CYTHON_UNUSED
283 # endif
284 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
285 # define CYTHON_UNUSED __attribute__ ((__unused__))
286 # else
287 # define CYTHON_UNUSED
288 # endif
289 #endif
290 #ifndef CYTHON_MAYBE_UNUSED_VAR
291 # if defined(__cplusplus)
292  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
293 # else
294 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
295 # endif
296 #endif
297 #ifndef CYTHON_NCP_UNUSED
298 # if CYTHON_COMPILING_IN_CPYTHON
299 # define CYTHON_NCP_UNUSED
300 # else
301 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
302 # endif
303 #endif
304 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
305 #ifdef _MSC_VER
306  #ifndef _MSC_STDINT_H_
307  #if _MSC_VER < 1300
308  typedef unsigned char uint8_t;
309  typedef unsigned int uint32_t;
310  #else
311  typedef unsigned __int8 uint8_t;
312  typedef unsigned __int32 uint32_t;
313  #endif
314  #endif
315 #else
316  #include <stdint.h>
317 #endif
318 #ifndef CYTHON_FALLTHROUGH
319  #if defined(__cplusplus) && __cplusplus >= 201103L
320  #if __has_cpp_attribute(fallthrough)
321  #define CYTHON_FALLTHROUGH [[fallthrough]]
322  #elif __has_cpp_attribute(clang::fallthrough)
323  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
324  #elif __has_cpp_attribute(gnu::fallthrough)
325  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
326  #endif
327  #endif
328  #ifndef CYTHON_FALLTHROUGH
329  #if __has_attribute(fallthrough)
330  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
331  #else
332  #define CYTHON_FALLTHROUGH
333  #endif
334  #endif
335  #if defined(__clang__ ) && defined(__apple_build_version__)
336  #if __apple_build_version__ < 7000000
337  #undef CYTHON_FALLTHROUGH
338  #define CYTHON_FALLTHROUGH
339  #endif
340  #endif
341 #endif
342 
343 #ifndef __cplusplus
344  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
345 #endif
346 #ifndef CYTHON_INLINE
347  #if defined(__clang__)
348  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
349  #else
350  #define CYTHON_INLINE inline
351  #endif
352 #endif
353 template<typename T>
354 void __Pyx_call_destructor(T& x) {
355  x.~T();
356 }
357 template<typename T>
358 class __Pyx_FakeReference {
359  public:
360  __Pyx_FakeReference() : ptr(NULL) { }
361  __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
362  T *operator->() { return ptr; }
363  T *operator&() { return ptr; }
364  operator T&() { return *ptr; }
365  template<typename U> bool operator ==(U other) { return *ptr == other; }
366  template<typename U> bool operator !=(U other) { return *ptr != other; }
367  private:
368  T *ptr;
369 };
370 
371 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
372  #define Py_OptimizeFlag 0
373 #endif
374 #define __PYX_BUILD_PY_SSIZE_T "n"
375 #define CYTHON_FORMAT_SSIZE_T "z"
376 #if PY_MAJOR_VERSION < 3
377  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
378  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
379  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
380  #define __Pyx_DefaultClassType PyClass_Type
381 #else
382  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
383 #if PY_VERSION_HEX >= 0x030800A4 && PY_VERSION_HEX < 0x030800B2
384  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
385  PyCode_New(a, 0, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
386 #else
387  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
388  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
389 #endif
390  #define __Pyx_DefaultClassType PyType_Type
391 #endif
392 #ifndef Py_TPFLAGS_CHECKTYPES
393  #define Py_TPFLAGS_CHECKTYPES 0
394 #endif
395 #ifndef Py_TPFLAGS_HAVE_INDEX
396  #define Py_TPFLAGS_HAVE_INDEX 0
397 #endif
398 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
399  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
400 #endif
401 #ifndef Py_TPFLAGS_HAVE_FINALIZE
402  #define Py_TPFLAGS_HAVE_FINALIZE 0
403 #endif
404 #ifndef METH_STACKLESS
405  #define METH_STACKLESS 0
406 #endif
407 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
408  #ifndef METH_FASTCALL
409  #define METH_FASTCALL 0x80
410  #endif
411  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
412  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
413  Py_ssize_t nargs, PyObject *kwnames);
414 #else
415  #define __Pyx_PyCFunctionFast _PyCFunctionFast
416  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
417 #endif
418 #if CYTHON_FAST_PYCCALL
419 #define __Pyx_PyFastCFunction_Check(func)\
420  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)))))
421 #else
422 #define __Pyx_PyFastCFunction_Check(func) 0
423 #endif
424 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
425  #define PyObject_Malloc(s) PyMem_Malloc(s)
426  #define PyObject_Free(p) PyMem_Free(p)
427  #define PyObject_Realloc(p) PyMem_Realloc(p)
428 #endif
429 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
430  #define PyMem_RawMalloc(n) PyMem_Malloc(n)
431  #define PyMem_RawRealloc(p, n) PyMem_Realloc(p, n)
432  #define PyMem_RawFree(p) PyMem_Free(p)
433 #endif
434 #if CYTHON_COMPILING_IN_PYSTON
435  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
436  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
437 #else
438  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
439  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
440 #endif
441 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
442  #define __Pyx_PyThreadState_Current PyThreadState_GET()
443 #elif PY_VERSION_HEX >= 0x03060000
444  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
445 #elif PY_VERSION_HEX >= 0x03000000
446  #define __Pyx_PyThreadState_Current PyThreadState_GET()
447 #else
448  #define __Pyx_PyThreadState_Current _PyThreadState_Current
449 #endif
450 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
451 #include "pythread.h"
452 #define Py_tss_NEEDS_INIT 0
453 typedef int Py_tss_t;
454 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
455  *key = PyThread_create_key();
456  return 0;
457 }
458 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
459  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
460  *key = Py_tss_NEEDS_INIT;
461  return key;
462 }
463 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
464  PyObject_Free(key);
465 }
466 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
467  return *key != Py_tss_NEEDS_INIT;
468 }
469 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
470  PyThread_delete_key(*key);
471  *key = Py_tss_NEEDS_INIT;
472 }
473 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
474  return PyThread_set_key_value(*key, value);
475 }
476 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
477  return PyThread_get_key_value(*key);
478 }
479 #endif
480 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
481 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
482 #else
483 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
484 #endif
485 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
486  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
487  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
488 #else
489  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
490  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
491 #endif
492 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
493 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
494 #else
495 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
496 #endif
497 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
498  #define CYTHON_PEP393_ENABLED 1
499  #if defined(PyUnicode_IS_READY)
500  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
501  0 : _PyUnicode_Ready((PyObject *)(op)))
502  #else
503  #define __Pyx_PyUnicode_READY(op) (0)
504  #endif
505  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
506  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
507  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
508  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
509  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
510  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
511  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
512  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
513  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
514  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
515  #else
516  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
517  #endif
518  #else
519  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_LENGTH(u))
520  #endif
521 #else
522  #define CYTHON_PEP393_ENABLED 0
523  #define PyUnicode_1BYTE_KIND 1
524  #define PyUnicode_2BYTE_KIND 2
525  #define PyUnicode_4BYTE_KIND 4
526  #define __Pyx_PyUnicode_READY(op) (0)
527  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
528  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
529  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
530  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
531  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
532  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
533  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
534  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
535 #endif
536 #if CYTHON_COMPILING_IN_PYPY
537  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
538  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
539 #else
540  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
541  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
542  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
543 #endif
544 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
545  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
546 #endif
547 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
548  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
549 #endif
550 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
551  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
552 #endif
553 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
554 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
555 #if PY_MAJOR_VERSION >= 3
556  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
557 #else
558  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
559 #endif
560 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
561  #define PyObject_ASCII(o) PyObject_Repr(o)
562 #endif
563 #if PY_MAJOR_VERSION >= 3
564  #define PyBaseString_Type PyUnicode_Type
565  #define PyStringObject PyUnicodeObject
566  #define PyString_Type PyUnicode_Type
567  #define PyString_Check PyUnicode_Check
568  #define PyString_CheckExact PyUnicode_CheckExact
569 #ifndef PyObject_Unicode
570  #define PyObject_Unicode PyObject_Str
571 #endif
572 #endif
573 #if PY_MAJOR_VERSION >= 3
574  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
575  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
576 #else
577  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
578  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
579 #endif
580 #ifndef PySet_CheckExact
581  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
582 #endif
583 #if PY_VERSION_HEX >= 0x030900A4
584  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
585  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
586 #else
587  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
588  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
589 #endif
590 #if CYTHON_ASSUME_SAFE_MACROS
591  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
592 #else
593  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
594 #endif
595 #if PY_MAJOR_VERSION >= 3
596  #define PyIntObject PyLongObject
597  #define PyInt_Type PyLong_Type
598  #define PyInt_Check(op) PyLong_Check(op)
599  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
600  #define PyInt_FromString PyLong_FromString
601  #define PyInt_FromUnicode PyLong_FromUnicode
602  #define PyInt_FromLong PyLong_FromLong
603  #define PyInt_FromSize_t PyLong_FromSize_t
604  #define PyInt_FromSsize_t PyLong_FromSsize_t
605  #define PyInt_AsLong PyLong_AsLong
606  #define PyInt_AS_LONG PyLong_AS_LONG
607  #define PyInt_AsSsize_t PyLong_AsSsize_t
608  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
609  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
610  #define PyNumber_Int PyNumber_Long
611 #endif
612 #if PY_MAJOR_VERSION >= 3
613  #define PyBoolObject PyLongObject
614 #endif
615 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
616  #ifndef PyUnicode_InternFromString
617  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
618  #endif
619 #endif
620 #if PY_VERSION_HEX < 0x030200A4
621  typedef long Py_hash_t;
622  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
623  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
624 #else
625  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
626  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
627 #endif
628 #if PY_MAJOR_VERSION >= 3
629  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? ((void)(klass), PyMethod_New(func, self)) : __Pyx_NewRef(func))
630 #else
631  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
632 #endif
633 #if CYTHON_USE_ASYNC_SLOTS
634  #if PY_VERSION_HEX >= 0x030500B1
635  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
636  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
637  #else
638  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
639  #endif
640 #else
641  #define __Pyx_PyType_AsAsync(obj) NULL
642 #endif
643 #ifndef __Pyx_PyAsyncMethodsStruct
644  typedef struct {
645  unaryfunc am_await;
646  unaryfunc am_aiter;
647  unaryfunc am_anext;
648  } __Pyx_PyAsyncMethodsStruct;
649 #endif
650 
651 #if defined(WIN32) || defined(MS_WINDOWS)
652  #define _USE_MATH_DEFINES
653 #endif
654 #include <math.h>
655 #ifdef NAN
656 #define __PYX_NAN() ((float) NAN)
657 #else
658 static CYTHON_INLINE float __PYX_NAN() {
659  float value;
660  memset(&value, 0xFF, sizeof(value));
661  return value;
662 }
663 #endif
664 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
665 #define __Pyx_truncl trunc
666 #else
667 #define __Pyx_truncl truncl
668 #endif
669 
670 #define __PYX_MARK_ERR_POS(f_index, lineno) \
671  { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
672 #define __PYX_ERR(f_index, lineno, Ln_error) \
673  { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }
674 
675 #ifndef __PYX_EXTERN_C
676  #ifdef __cplusplus
677  #define __PYX_EXTERN_C extern "C"
678  #else
679  #define __PYX_EXTERN_C extern
680  #endif
681 #endif
682 
683 #define __PYX_HAVE__imate___c_linear_operator__py_c_matrix
684 #define __PYX_HAVE_API__imate___c_linear_operator__py_c_matrix
685 /* Early includes */
686 #include "ios"
687 #include "new"
688 #include "stdexcept"
689 #include "typeinfo"
690 #include "c_linear_operator.h"
691 #include "c_matrix.h"
692 #include "c_dense_matrix.h"
693 #include "c_csr_matrix.h"
694 #include "c_csc_matrix.h"
695 #include "pythread.h"
696 #include <string.h>
697 #include <stdlib.h>
698 #include <stdio.h>
699 #include "pystate.h"
700 #ifdef _OPENMP
701 #include <omp.h>
702 #endif /* _OPENMP */
703 
704 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
705 #define CYTHON_WITHOUT_ASSERTIONS
706 #endif
707 
708 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
709  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
710 
711 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
712 #define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
713 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
714 #define __PYX_DEFAULT_STRING_ENCODING ""
715 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
716 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
717 #define __Pyx_uchar_cast(c) ((unsigned char)c)
718 #define __Pyx_long_cast(x) ((long)x)
719 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
720  (sizeof(type) < sizeof(Py_ssize_t)) ||\
721  (sizeof(type) > sizeof(Py_ssize_t) &&\
722  likely(v < (type)PY_SSIZE_T_MAX ||\
723  v == (type)PY_SSIZE_T_MAX) &&\
724  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
725  v == (type)PY_SSIZE_T_MIN))) ||\
726  (sizeof(type) == sizeof(Py_ssize_t) &&\
727  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
728  v == (type)PY_SSIZE_T_MAX))) )
729 static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
730  return (size_t) i < (size_t) limit;
731 }
732 #if defined (__cplusplus) && __cplusplus >= 201103L
733  #include <cstdlib>
734  #define __Pyx_sst_abs(value) std::abs(value)
735 #elif SIZEOF_INT >= SIZEOF_SIZE_T
736  #define __Pyx_sst_abs(value) abs(value)
737 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
738  #define __Pyx_sst_abs(value) labs(value)
739 #elif defined (_MSC_VER)
740  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
741 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
742  #define __Pyx_sst_abs(value) llabs(value)
743 #elif defined (__GNUC__)
744  #define __Pyx_sst_abs(value) __builtin_llabs(value)
745 #else
746  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
747 #endif
748 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
749 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
750 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
751 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
752 #define __Pyx_PyBytes_FromString PyBytes_FromString
753 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
754 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
755 #if PY_MAJOR_VERSION < 3
756  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
757  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
758 #else
759  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
760  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
761 #endif
762 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
763 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
764 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
765 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
766 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
767 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
768 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
769 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
770 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
771 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
772 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
773 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
774 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
775 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
776 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
777 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
778 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
779  const Py_UNICODE *u_end = u;
780  while (*u_end++) ;
781  return (size_t)(u_end - u - 1);
782 }
783 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
784 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
785 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
786 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
787 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
788 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
789 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
790 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
791 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
792 #define __Pyx_PySequence_Tuple(obj)\
793  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
794 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
795 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
796 #if CYTHON_ASSUME_SAFE_MACROS
797 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
798 #else
799 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
800 #endif
801 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
802 #if PY_MAJOR_VERSION >= 3
803 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
804 #else
805 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
806 #endif
807 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
808 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
809 static int __Pyx_sys_getdefaultencoding_not_ascii;
810 static int __Pyx_init_sys_getdefaultencoding_params(void) {
811  PyObject* sys;
812  PyObject* default_encoding = NULL;
813  PyObject* ascii_chars_u = NULL;
814  PyObject* ascii_chars_b = NULL;
815  const char* default_encoding_c;
816  sys = PyImport_ImportModule("sys");
817  if (!sys) goto bad;
818  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
819  Py_DECREF(sys);
820  if (!default_encoding) goto bad;
821  default_encoding_c = PyBytes_AsString(default_encoding);
822  if (!default_encoding_c) goto bad;
823  if (strcmp(default_encoding_c, "ascii") == 0) {
824  __Pyx_sys_getdefaultencoding_not_ascii = 0;
825  } else {
826  char ascii_chars[128];
827  int c;
828  for (c = 0; c < 128; c++) {
829  ascii_chars[c] = c;
830  }
831  __Pyx_sys_getdefaultencoding_not_ascii = 1;
832  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
833  if (!ascii_chars_u) goto bad;
834  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
835  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
836  PyErr_Format(
837  PyExc_ValueError,
838  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
839  default_encoding_c);
840  goto bad;
841  }
842  Py_DECREF(ascii_chars_u);
843  Py_DECREF(ascii_chars_b);
844  }
845  Py_DECREF(default_encoding);
846  return 0;
847 bad:
848  Py_XDECREF(default_encoding);
849  Py_XDECREF(ascii_chars_u);
850  Py_XDECREF(ascii_chars_b);
851  return -1;
852 }
853 #endif
854 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
855 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
856 #else
857 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
858 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
859 static char* __PYX_DEFAULT_STRING_ENCODING;
860 static int __Pyx_init_sys_getdefaultencoding_params(void) {
861  PyObject* sys;
862  PyObject* default_encoding = NULL;
863  char* default_encoding_c;
864  sys = PyImport_ImportModule("sys");
865  if (!sys) goto bad;
866  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
867  Py_DECREF(sys);
868  if (!default_encoding) goto bad;
869  default_encoding_c = PyBytes_AsString(default_encoding);
870  if (!default_encoding_c) goto bad;
871  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
872  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
873  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
874  Py_DECREF(default_encoding);
875  return 0;
876 bad:
877  Py_XDECREF(default_encoding);
878  return -1;
879 }
880 #endif
881 #endif
882 
883 
884 /* Test for GCC > 2.95 */
885 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
886  #define likely(x) __builtin_expect(!!(x), 1)
887  #define unlikely(x) __builtin_expect(!!(x), 0)
888 #else /* !__GNUC__ or GCC < 2.95 */
889  #define likely(x) (x)
890  #define unlikely(x) (x)
891 #endif /* __GNUC__ */
892 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
893 
894 static PyObject *__pyx_m = NULL;
895 static PyObject *__pyx_d;
896 static PyObject *__pyx_b;
897 static PyObject *__pyx_cython_runtime = NULL;
898 static PyObject *__pyx_empty_tuple;
899 static PyObject *__pyx_empty_bytes;
900 static PyObject *__pyx_empty_unicode;
901 static int __pyx_lineno;
902 static int __pyx_clineno = 0;
903 static const char * __pyx_cfilenm= __FILE__;
904 static const char *__pyx_filename;
905 
906 
907 static const char *__pyx_f[] = {
908  "imate/_c_linear_operator/py_c_matrix.pyx",
909  "stringsource",
910 };
911 /* MemviewSliceStruct.proto */
912 struct __pyx_memoryview_obj;
913 typedef struct {
914  struct __pyx_memoryview_obj *memview;
915  char *data;
916  Py_ssize_t shape[8];
917  Py_ssize_t strides[8];
918  Py_ssize_t suboffsets[8];
919 } __Pyx_memviewslice;
920 #define __Pyx_MemoryView_Len(m) (m.shape[0])
921 
922 /* Atomics.proto */
923 #include <pythread.h>
924 #ifndef CYTHON_ATOMICS
925  #define CYTHON_ATOMICS 1
926 #endif
927 #define __pyx_atomic_int_type int
928 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
929  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
930  !defined(__i386__)
931  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
932  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
933  #ifdef __PYX_DEBUG_ATOMICS
934  #warning "Using GNU atomics"
935  #endif
936 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
937  #include <Windows.h>
938  #undef __pyx_atomic_int_type
939  #define __pyx_atomic_int_type LONG
940  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
941  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
942  #ifdef __PYX_DEBUG_ATOMICS
943  #pragma message ("Using MSVC atomics")
944  #endif
945 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
946  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
947  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
948  #ifdef __PYX_DEBUG_ATOMICS
949  #warning "Using Intel atomics"
950  #endif
951 #else
952  #undef CYTHON_ATOMICS
953  #define CYTHON_ATOMICS 0
954  #ifdef __PYX_DEBUG_ATOMICS
955  #warning "Not using atomics"
956  #endif
957 #endif
958 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
959 #if CYTHON_ATOMICS
960  #define __pyx_add_acquisition_count(memview)\
961  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
962  #define __pyx_sub_acquisition_count(memview)\
963  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
964 #else
965  #define __pyx_add_acquisition_count(memview)\
966  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
967  #define __pyx_sub_acquisition_count(memview)\
968  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
969 #endif
970 
971 /* ForceInitThreads.proto */
972 #ifndef __PYX_FORCE_INIT_THREADS
973  #define __PYX_FORCE_INIT_THREADS 0
974 #endif
975 
976 /* NoFastGil.proto */
977 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
978 #define __Pyx_PyGILState_Release PyGILState_Release
979 #define __Pyx_FastGIL_Remember()
980 #define __Pyx_FastGIL_Forget()
981 #define __Pyx_FastGilFuncInit()
982 
983 /* BufferFormatStructs.proto */
984 #define IS_UNSIGNED(type) (((type) -1) > 0)
985 struct __Pyx_StructField_;
986 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
987 typedef struct {
988  const char* name;
989  struct __Pyx_StructField_* fields;
990  size_t size;
991  size_t arraysize[8];
992  int ndim;
993  char typegroup;
994  char is_unsigned;
995  int flags;
996 } __Pyx_TypeInfo;
997 typedef struct __Pyx_StructField_ {
998  __Pyx_TypeInfo* type;
999  const char* name;
1000  size_t offset;
1001 } __Pyx_StructField;
1002 typedef struct {
1003  __Pyx_StructField* field;
1004  size_t parent_offset;
1005 } __Pyx_BufFmt_StackElem;
1006 typedef struct {
1007  __Pyx_StructField root;
1008  __Pyx_BufFmt_StackElem* head;
1009  size_t fmt_offset;
1010  size_t new_count, enc_count;
1011  size_t struct_alignment;
1012  int is_complex;
1013  char enc_type;
1014  char new_packmode;
1015  char enc_packmode;
1016  char is_valid_array;
1017 } __Pyx_BufFmt_Context;
1018 
1019 
1020 /* "_definitions/types.pxd":97
1021  * ctypedef unsigned int[:] MemoryViewLongIndexType
1022  * ELSE:
1023  * ctypedef int LongIndexType # <<<<<<<<<<<<<<
1024  * ctypedef const int ConstLongIndexType
1025  * ctypedef int[:] MemoryViewLongIndexType
1026  */
1027 typedef int __pyx_t_5imate_12_definitions_5types_LongIndexType;
1028 
1029 /* "_definitions/types.pxd":98
1030  * ELSE:
1031  * ctypedef int LongIndexType
1032  * ctypedef const int ConstLongIndexType # <<<<<<<<<<<<<<
1033  * ctypedef int[:] MemoryViewLongIndexType
1034  *
1035  */
1036 typedef int const __pyx_t_5imate_12_definitions_5types_ConstLongIndexType;
1037 
1038 /* "_definitions/types.pxd":102
1039  *
1040  * # Used for indices of small matrices, or small size iterators
1041  * ctypedef int IndexType # <<<<<<<<<<<<<<
1042  * ctypedef const int ConstIndexType
1043  * ctypedef int[:] MemoryViewIndexType
1044  */
1045 typedef int __pyx_t_5imate_12_definitions_5types_IndexType;
1046 
1047 /* "_definitions/types.pxd":103
1048  * # Used for indices of small matrices, or small size iterators
1049  * ctypedef int IndexType
1050  * ctypedef const int ConstIndexType # <<<<<<<<<<<<<<
1051  * ctypedef int[:] MemoryViewIndexType
1052  *
1053  */
1054 typedef int const __pyx_t_5imate_12_definitions_5types_ConstIndexType;
1055 
1056 /* "_definitions/types.pxd":107
1057  *
1058  * # Used for both flags and integers used as signals, including negative integers
1059  * ctypedef int FlagType # <<<<<<<<<<<<<<
1060  * ctypedef const int ConstFlagType
1061  * ctypedef int[:] MemoryViewFlagType
1062  */
1063 typedef int __pyx_t_5imate_12_definitions_5types_FlagType;
1064 
1065 /* "_definitions/types.pxd":108
1066  * # Used for both flags and integers used as signals, including negative integers
1067  * ctypedef int FlagType
1068  * ctypedef const int ConstFlagType # <<<<<<<<<<<<<<
1069  * ctypedef int[:] MemoryViewFlagType
1070  *
1071  */
1072 typedef int const __pyx_t_5imate_12_definitions_5types_ConstFlagType;
1073 
1074 /*--- Type declarations ---*/
1075 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1076 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1077 struct __pyx_array_obj;
1078 struct __pyx_MemviewEnum_obj;
1079 struct __pyx_memoryview_obj;
1080 struct __pyx_memoryviewslice_obj;
1081 
1082 /* "_definitions/types.pxd":99
1083  * ctypedef int LongIndexType
1084  * ctypedef const int ConstLongIndexType
1085  * ctypedef int[:] MemoryViewLongIndexType # <<<<<<<<<<<<<<
1086  *
1087  * # Used for indices of small matrices, or small size iterators
1088  */
1089 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType;
1090 
1091 /* "_definitions/types.pxd":104
1092  * ctypedef int IndexType
1093  * ctypedef const int ConstIndexType
1094  * ctypedef int[:] MemoryViewIndexType # <<<<<<<<<<<<<<
1095  *
1096  * # Used for both flags and integers used as signals, including negative integers
1097  */
1098 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewIndexType;
1099 
1100 /* "_definitions/types.pxd":109
1101  * ctypedef int FlagType
1102  * ctypedef const int ConstFlagType
1103  * ctypedef int[:] MemoryViewFlagType # <<<<<<<<<<<<<<
1104  *
1105  *
1106  */
1107 typedef __Pyx_memviewslice __pyx_t_5imate_12_definitions_5types_MemoryViewFlagType;
1108 
1109 /* "_definitions/types.pxd":116
1110  * # ==============
1111  *
1112  * ctypedef double (*kernel_type)( # noqa: E211 # <<<<<<<<<<<<<<
1113  * const double x,
1114  * const double kernel_param) nogil
1115  */
1116 typedef double (*__pyx_t_5imate_12_definitions_5types_kernel_type)(double const , double const );
1117 
1118 /* "py_c_linear_operator.pxd":23
1119  * # ===================
1120  *
1121  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1122  *
1123  * # Attributes
1124  */
1125 struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1126  PyObject_HEAD
1127  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtab;
1128  cLinearOperator<float> *Aop_float;
1129  cLinearOperator<double> *Aop_double;
1130  cLinearOperator<long double> *Aop_long_double;
1131  char *data_type_name;
1132  char *long_index_type_name;
1133  __pyx_t_5imate_12_definitions_5types_IndexType num_parameters;
1134  PyObject *parameters;
1135 };
1136 
1137 
1138 /* "imate/_c_linear_operator/py_c_matrix.pxd":21
1139  * # =========
1140  *
1141  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1142  * cdef A_csr
1143  * cdef A_indices_copy
1144  */
1145 struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1146  struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1147  PyObject *A_csr;
1148  PyObject *A_indices_copy;
1149  PyObject *A_index_pointer_copy;
1150 };
1151 
1152 
1153 /* "View.MemoryView":105
1154  *
1155  * @cname("__pyx_array")
1156  * cdef class array: # <<<<<<<<<<<<<<
1157  *
1158  * cdef:
1159  */
1160 struct __pyx_array_obj {
1161  PyObject_HEAD
1162  struct __pyx_vtabstruct_array *__pyx_vtab;
1163  char *data;
1164  Py_ssize_t len;
1165  char *format;
1166  int ndim;
1167  Py_ssize_t *_shape;
1168  Py_ssize_t *_strides;
1169  Py_ssize_t itemsize;
1170  PyObject *mode;
1171  PyObject *_format;
1172  void (*callback_free_data)(void *);
1173  int free_data;
1174  int dtype_is_object;
1175 };
1176 
1177 
1178 /* "View.MemoryView":279
1179  *
1180  * @cname('__pyx_MemviewEnum')
1181  * cdef class Enum(object): # <<<<<<<<<<<<<<
1182  * cdef object name
1183  * def __init__(self, name):
1184  */
1185 struct __pyx_MemviewEnum_obj {
1186  PyObject_HEAD
1187  PyObject *name;
1188 };
1189 
1190 
1191 /* "View.MemoryView":330
1192  *
1193  * @cname('__pyx_memoryview')
1194  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1195  *
1196  * cdef object obj
1197  */
1198 struct __pyx_memoryview_obj {
1199  PyObject_HEAD
1200  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1201  PyObject *obj;
1202  PyObject *_size;
1203  PyObject *_array_interface;
1204  PyThread_type_lock lock;
1205  __pyx_atomic_int acquisition_count[2];
1206  __pyx_atomic_int *acquisition_count_aligned_p;
1207  Py_buffer view;
1208  int flags;
1209  int dtype_is_object;
1210  __Pyx_TypeInfo *typeinfo;
1211 };
1212 
1213 
1214 /* "View.MemoryView":965
1215  *
1216  * @cname('__pyx_memoryviewslice')
1217  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1218  * "Internal class for passing memoryview slices to Python"
1219  *
1220  */
1221 struct __pyx_memoryviewslice_obj {
1222  struct __pyx_memoryview_obj __pyx_base;
1223  __Pyx_memviewslice from_slice;
1224  PyObject *from_object;
1225  PyObject *(*to_object_func)(char *);
1226  int (*to_dtype_func)(char *, PyObject *);
1227 };
1228 
1229 
1230 
1231 /* "py_c_linear_operator.pxd":23
1232  * # ===================
1233  *
1234  * cdef class pycLinearOperator(object): # <<<<<<<<<<<<<<
1235  *
1236  * # Attributes
1237  */
1238 
1239 struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator {
1240  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_rows)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1241  __pyx_t_5imate_12_definitions_5types_LongIndexType (*get_num_columns)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1242  cLinearOperator<float> *(*get_linear_operator_float)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1243  cLinearOperator<double> *(*get_linear_operator_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1244  cLinearOperator<long double> *(*get_linear_operator_long_double)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *);
1245  void (*dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1246  void (*transpose_dot)(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1247 };
1248 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
1249 
1250 
1251 /* "imate/_c_linear_operator/py_c_matrix.pyx":33
1252  * # =========
1253  *
1254  * cdef class pycMatrix(pycLinearOperator): # <<<<<<<<<<<<<<
1255  * """
1256  * Defines a linear operator that is a constant matrix.
1257  */
1258 
1259 struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix {
1260  struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator __pyx_base;
1261 };
1262 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
1263 
1264 
1265 /* "View.MemoryView":105
1266  *
1267  * @cname("__pyx_array")
1268  * cdef class array: # <<<<<<<<<<<<<<
1269  *
1270  * cdef:
1271  */
1272 
1273 struct __pyx_vtabstruct_array {
1274  PyObject *(*get_memview)(struct __pyx_array_obj *);
1275 };
1276 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1277 
1278 
1279 /* "View.MemoryView":330
1280  *
1281  * @cname('__pyx_memoryview')
1282  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1283  *
1284  * cdef object obj
1285  */
1286 
1287 struct __pyx_vtabstruct_memoryview {
1288  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1289  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1290  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1291  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1292  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1293  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1294  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1295 };
1296 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1297 
1298 
1299 /* "View.MemoryView":965
1300  *
1301  * @cname('__pyx_memoryviewslice')
1302  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1303  * "Internal class for passing memoryview slices to Python"
1304  *
1305  */
1306 
1307 struct __pyx_vtabstruct__memoryviewslice {
1308  struct __pyx_vtabstruct_memoryview __pyx_base;
1309 };
1310 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1311 
1312 /* --- Runtime support code (head) --- */
1313 /* Refnanny.proto */
1314 #ifndef CYTHON_REFNANNY
1315  #define CYTHON_REFNANNY 0
1316 #endif
1317 #if CYTHON_REFNANNY
1318  typedef struct {
1319  void (*INCREF)(void*, PyObject*, int);
1320  void (*DECREF)(void*, PyObject*, int);
1321  void (*GOTREF)(void*, PyObject*, int);
1322  void (*GIVEREF)(void*, PyObject*, int);
1323  void* (*SetupContext)(const char*, int, const char*);
1324  void (*FinishContext)(void**);
1325  } __Pyx_RefNannyAPIStruct;
1326  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1327  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1328  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1329 #ifdef WITH_THREAD
1330  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1331  if (acquire_gil) {\
1332  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1333  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1334  PyGILState_Release(__pyx_gilstate_save);\
1335  } else {\
1336  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1337  }
1338 #else
1339  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1340  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1341 #endif
1342  #define __Pyx_RefNannyFinishContext()\
1343  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1344  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1345  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1346  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1347  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1348  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1349  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1350  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1351  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1352 #else
1353  #define __Pyx_RefNannyDeclarations
1354  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1355  #define __Pyx_RefNannyFinishContext()
1356  #define __Pyx_INCREF(r) Py_INCREF(r)
1357  #define __Pyx_DECREF(r) Py_DECREF(r)
1358  #define __Pyx_GOTREF(r)
1359  #define __Pyx_GIVEREF(r)
1360  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1361  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1362  #define __Pyx_XGOTREF(r)
1363  #define __Pyx_XGIVEREF(r)
1364 #endif
1365 #define __Pyx_XDECREF_SET(r, v) do {\
1366  PyObject *tmp = (PyObject *) r;\
1367  r = v; __Pyx_XDECREF(tmp);\
1368  } while (0)
1369 #define __Pyx_DECREF_SET(r, v) do {\
1370  PyObject *tmp = (PyObject *) r;\
1371  r = v; __Pyx_DECREF(tmp);\
1372  } while (0)
1373 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1374 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1375 
1376 /* PyObjectGetAttrStr.proto */
1377 #if CYTHON_USE_TYPE_SLOTS
1378 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1379 #else
1380 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1381 #endif
1382 
1383 /* GetBuiltinName.proto */
1384 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1385 
1386 /* RaiseDoubleKeywords.proto */
1387 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1388 
1389 /* ParseKeywords.proto */
1390 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1391  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1392  const char* function_name);
1393 
1394 /* RaiseArgTupleInvalid.proto */
1395 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1396  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1397 
1398 /* PyThreadStateGet.proto */
1399 #if CYTHON_FAST_THREAD_STATE
1400 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1401 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1402 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1403 #else
1404 #define __Pyx_PyThreadState_declare
1405 #define __Pyx_PyThreadState_assign
1406 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1407 #endif
1408 
1409 /* PyErrFetchRestore.proto */
1410 #if CYTHON_FAST_THREAD_STATE
1411 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1412 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1413 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1414 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1415 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1416 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1417 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1418 #if CYTHON_COMPILING_IN_CPYTHON
1419 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1420 #else
1421 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1422 #endif
1423 #else
1424 #define __Pyx_PyErr_Clear() PyErr_Clear()
1425 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1426 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1427 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1428 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1429 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1430 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1431 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1432 #endif
1433 
1434 /* Profile.proto */
1435 #ifndef CYTHON_PROFILE
1436 #if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_PYSTON
1437  #define CYTHON_PROFILE 0
1438 #else
1439  #define CYTHON_PROFILE 1
1440 #endif
1441 #endif
1442 #ifndef CYTHON_TRACE_NOGIL
1443  #define CYTHON_TRACE_NOGIL 0
1444 #else
1445  #if CYTHON_TRACE_NOGIL && !defined(CYTHON_TRACE)
1446  #define CYTHON_TRACE 1
1447  #endif
1448 #endif
1449 #ifndef CYTHON_TRACE
1450  #define CYTHON_TRACE 0
1451 #endif
1452 #if CYTHON_TRACE
1453  #undef CYTHON_PROFILE_REUSE_FRAME
1454 #endif
1455 #ifndef CYTHON_PROFILE_REUSE_FRAME
1456  #define CYTHON_PROFILE_REUSE_FRAME 0
1457 #endif
1458 #if CYTHON_PROFILE || CYTHON_TRACE
1459  #include "compile.h"
1460  #include "frameobject.h"
1461  #include "traceback.h"
1462  #if CYTHON_PROFILE_REUSE_FRAME
1463  #define CYTHON_FRAME_MODIFIER static
1464  #define CYTHON_FRAME_DEL(frame)
1465  #else
1466  #define CYTHON_FRAME_MODIFIER
1467  #define CYTHON_FRAME_DEL(frame) Py_CLEAR(frame)
1468  #endif
1469  #define __Pyx_TraceDeclarations\
1470  static PyCodeObject *__pyx_frame_code = NULL;\
1471  CYTHON_FRAME_MODIFIER PyFrameObject *__pyx_frame = NULL;\
1472  int __Pyx_use_tracing = 0;
1473  #define __Pyx_TraceFrameInit(codeobj)\
1474  if (codeobj) __pyx_frame_code = (PyCodeObject*) codeobj;
1475 #if PY_VERSION_HEX >= 0x030a00b1
1476  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1477  (unlikely((tstate)->cframe->use_tracing) &&\
1478  (!(check_tracing) || !(tstate)->tracing) &&\
1479  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1480  #define __Pyx_SetTracing(tstate, enable)\
1481  (tstate)->cframe->use_tracing = (enable)
1482 #else
1483  #define __Pyx_IsTracing(tstate, check_tracing, check_funcs)\
1484  (unlikely((tstate)->use_tracing) &&\
1485  (!(check_tracing) || !(tstate)->tracing) &&\
1486  (!(check_funcs) || (tstate)->c_profilefunc || (CYTHON_TRACE && (tstate)->c_tracefunc)))
1487  #define __Pyx_SetTracing(tstate, enable)\
1488  (tstate)->use_tracing = (enable)
1489 #endif
1490  #ifdef WITH_THREAD
1491  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1492  if (nogil) {\
1493  if (CYTHON_TRACE_NOGIL) {\
1494  PyThreadState *tstate;\
1495  PyGILState_STATE state = PyGILState_Ensure();\
1496  tstate = __Pyx_PyThreadState_Current;\
1497  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1498  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1499  }\
1500  PyGILState_Release(state);\
1501  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1502  }\
1503  } else {\
1504  PyThreadState* tstate = PyThreadState_GET();\
1505  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1506  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1507  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1508  }\
1509  }
1510  #else
1511  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error)\
1512  { PyThreadState* tstate = PyThreadState_GET();\
1513  if (__Pyx_IsTracing(tstate, 1, 1)) {\
1514  __Pyx_use_tracing = __Pyx_TraceSetupAndCall(&__pyx_frame_code, &__pyx_frame, tstate, funcname, srcfile, firstlineno);\
1515  if (unlikely(__Pyx_use_tracing < 0)) goto_error;\
1516  }\
1517  }
1518  #endif
1519  #define __Pyx_TraceException()\
1520  if (likely(!__Pyx_use_tracing)); else {\
1521  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1522  if (__Pyx_IsTracing(tstate, 0, 1)) {\
1523  tstate->tracing++;\
1524  __Pyx_SetTracing(tstate, 0);\
1525  PyObject *exc_info = __Pyx_GetExceptionTuple(tstate);\
1526  if (exc_info) {\
1527  if (CYTHON_TRACE && tstate->c_tracefunc)\
1528  tstate->c_tracefunc(\
1529  tstate->c_traceobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1530  tstate->c_profilefunc(\
1531  tstate->c_profileobj, __pyx_frame, PyTrace_EXCEPTION, exc_info);\
1532  Py_DECREF(exc_info);\
1533  }\
1534  __Pyx_SetTracing(tstate, 1);\
1535  tstate->tracing--;\
1536  }\
1537  }
1538  static void __Pyx_call_return_trace_func(PyThreadState *tstate, PyFrameObject *frame, PyObject *result) {
1539  PyObject *type, *value, *traceback;
1540  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1541  tstate->tracing++;
1542  __Pyx_SetTracing(tstate, 0);
1543  if (CYTHON_TRACE && tstate->c_tracefunc)
1544  tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_RETURN, result);
1545  if (tstate->c_profilefunc)
1546  tstate->c_profilefunc(tstate->c_profileobj, frame, PyTrace_RETURN, result);
1547  CYTHON_FRAME_DEL(frame);
1548  __Pyx_SetTracing(tstate, 1);
1549  tstate->tracing--;
1550  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1551  }
1552  #ifdef WITH_THREAD
1553  #define __Pyx_TraceReturn(result, nogil)\
1554  if (likely(!__Pyx_use_tracing)); else {\
1555  if (nogil) {\
1556  if (CYTHON_TRACE_NOGIL) {\
1557  PyThreadState *tstate;\
1558  PyGILState_STATE state = PyGILState_Ensure();\
1559  tstate = __Pyx_PyThreadState_Current;\
1560  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1561  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1562  }\
1563  PyGILState_Release(state);\
1564  }\
1565  } else {\
1566  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1567  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1568  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1569  }\
1570  }\
1571  }
1572  #else
1573  #define __Pyx_TraceReturn(result, nogil)\
1574  if (likely(!__Pyx_use_tracing)); else {\
1575  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1576  if (__Pyx_IsTracing(tstate, 0, 0)) {\
1577  __Pyx_call_return_trace_func(tstate, __pyx_frame, (PyObject*)result);\
1578  }\
1579  }
1580  #endif
1581  static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno);
1582  static int __Pyx_TraceSetupAndCall(PyCodeObject** code, PyFrameObject** frame, PyThreadState* tstate, const char *funcname, const char *srcfile, int firstlineno);
1583 #else
1584  #define __Pyx_TraceDeclarations
1585  #define __Pyx_TraceFrameInit(codeobj)
1586  #define __Pyx_TraceCall(funcname, srcfile, firstlineno, nogil, goto_error) if ((1)); else goto_error;
1587  #define __Pyx_TraceException()
1588  #define __Pyx_TraceReturn(result, nogil)
1589 #endif
1590 #if CYTHON_TRACE
1591  static int __Pyx_call_line_trace_func(PyThreadState *tstate, PyFrameObject *frame, int lineno) {
1592  int ret;
1593  PyObject *type, *value, *traceback;
1594  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
1595  __Pyx_PyFrame_SetLineNumber(frame, lineno);
1596  tstate->tracing++;
1597  __Pyx_SetTracing(tstate, 0);
1598  ret = tstate->c_tracefunc(tstate->c_traceobj, frame, PyTrace_LINE, NULL);
1599  __Pyx_SetTracing(tstate, 1);
1600  tstate->tracing--;
1601  if (likely(!ret)) {
1602  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
1603  } else {
1604  Py_XDECREF(type);
1605  Py_XDECREF(value);
1606  Py_XDECREF(traceback);
1607  }
1608  return ret;
1609  }
1610  #ifdef WITH_THREAD
1611  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1612  if (likely(!__Pyx_use_tracing)); else {\
1613  if (nogil) {\
1614  if (CYTHON_TRACE_NOGIL) {\
1615  int ret = 0;\
1616  PyThreadState *tstate;\
1617  PyGILState_STATE state = PyGILState_Ensure();\
1618  tstate = __Pyx_PyThreadState_Current;\
1619  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1620  ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1621  }\
1622  PyGILState_Release(state);\
1623  if (unlikely(ret)) goto_error;\
1624  }\
1625  } else {\
1626  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1627  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1628  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1629  if (unlikely(ret)) goto_error;\
1630  }\
1631  }\
1632  }
1633  #else
1634  #define __Pyx_TraceLine(lineno, nogil, goto_error)\
1635  if (likely(!__Pyx_use_tracing)); else {\
1636  PyThreadState* tstate = __Pyx_PyThreadState_Current;\
1637  if (__Pyx_IsTracing(tstate, 0, 0) && tstate->c_tracefunc && __pyx_frame->f_trace) {\
1638  int ret = __Pyx_call_line_trace_func(tstate, __pyx_frame, lineno);\
1639  if (unlikely(ret)) goto_error;\
1640  }\
1641  }
1642  #endif
1643 #else
1644  #define __Pyx_TraceLine(lineno, nogil, goto_error) if ((1)); else goto_error;
1645 #endif
1646 
1647 /* PyObjectCall.proto */
1648 #if CYTHON_COMPILING_IN_CPYTHON
1649 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1650 #else
1651 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1652 #endif
1653 
1654 /* RaiseException.proto */
1655 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1656 
1657 /* PyIntCompare.proto */
1658 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, long intval, long inplace);
1659 
1660 /* IncludeStringH.proto */
1661 #include <string.h>
1662 
1663 /* BytesEquals.proto */
1664 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1665 
1666 /* PyDictVersioning.proto */
1667 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
1668 #define __PYX_DICT_VERSION_INIT ((PY_UINT64_T) -1)
1669 #define __PYX_GET_DICT_VERSION(dict) (((PyDictObject*)(dict))->ma_version_tag)
1670 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
1671  (version_var) = __PYX_GET_DICT_VERSION(dict);\
1672  (cache_var) = (value);
1673 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
1674  static PY_UINT64_T __pyx_dict_version = 0;\
1675  static PyObject *__pyx_dict_cached_value = NULL;\
1676  if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
1677  (VAR) = __pyx_dict_cached_value;\
1678  } else {\
1679  (VAR) = __pyx_dict_cached_value = (LOOKUP);\
1680  __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
1681  }\
1682 }
1683 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
1684 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
1685 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
1686 #else
1687 #define __PYX_GET_DICT_VERSION(dict) (0)
1688 #define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
1689 #define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) (VAR) = (LOOKUP);
1690 #endif
1691 
1692 /* GetModuleGlobalName.proto */
1693 #if CYTHON_USE_DICT_VERSIONS
1694 #define __Pyx_GetModuleGlobalName(var, name) {\
1695  static PY_UINT64_T __pyx_dict_version = 0;\
1696  static PyObject *__pyx_dict_cached_value = NULL;\
1697  (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
1698  (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
1699  __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1700 }
1701 #define __Pyx_GetModuleGlobalNameUncached(var, name) {\
1702  PY_UINT64_T __pyx_dict_version;\
1703  PyObject *__pyx_dict_cached_value;\
1704  (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
1705 }
1706 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
1707 #else
1708 #define __Pyx_GetModuleGlobalName(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1709 #define __Pyx_GetModuleGlobalNameUncached(var, name) (var) = __Pyx__GetModuleGlobalName(name)
1710 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
1711 #endif
1712 
1713 /* PyCFunctionFastCall.proto */
1714 #if CYTHON_FAST_PYCCALL
1715 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1716 #else
1717 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1718 #endif
1719 
1720 /* PyFunctionFastCall.proto */
1721 #if CYTHON_FAST_PYCALL
1722 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1723  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1724 #if 1 || PY_VERSION_HEX < 0x030600B1
1725 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
1726 #else
1727 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1728 #endif
1729 #define __Pyx_BUILD_ASSERT_EXPR(cond)\
1730  (sizeof(char [1 - 2*!(cond)]) - 1)
1731 #ifndef Py_MEMBER_SIZE
1732 #define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
1733 #endif
1734  static size_t __pyx_pyframe_localsplus_offset = 0;
1735  #include "frameobject.h"
1736  #define __Pxy_PyFrame_Initialize_Offsets()\
1737  ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
1738  (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
1739  #define __Pyx_PyFrame_GetLocalsplus(frame)\
1740  (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
1741 #endif
1742 
1743 /* PyObjectCall2Args.proto */
1744 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);
1745 
1746 /* PyObjectCallMethO.proto */
1747 #if CYTHON_COMPILING_IN_CPYTHON
1748 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1749 #endif
1750 
1751 /* PyObjectCallOneArg.proto */
1752 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1753 
1754 /* PyObjectCallNoArg.proto */
1755 #if CYTHON_COMPILING_IN_CPYTHON
1756 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1757 #else
1758 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1759 #endif
1760 
1761 /* GetItemInt.proto */
1762 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1763  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1764  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1765  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1766  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1767 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1768  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1769  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1770  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1771 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1772  int wraparound, int boundscheck);
1773 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1774  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1775  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1776  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1777 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1778  int wraparound, int boundscheck);
1779 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1780 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1781  int is_list, int wraparound, int boundscheck);
1782 
1783 /* DictGetItem.proto */
1784 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1785 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1786 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1787  (likely(PyDict_CheckExact(obj)) ?\
1788  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1789 #else
1790 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1791 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1792 #endif
1793 
1794 /* MemviewSliceInit.proto */
1795 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1796 #define __Pyx_MEMVIEW_DIRECT 1
1797 #define __Pyx_MEMVIEW_PTR 2
1798 #define __Pyx_MEMVIEW_FULL 4
1799 #define __Pyx_MEMVIEW_CONTIG 8
1800 #define __Pyx_MEMVIEW_STRIDED 16
1801 #define __Pyx_MEMVIEW_FOLLOW 32
1802 #define __Pyx_IS_C_CONTIG 1
1803 #define __Pyx_IS_F_CONTIG 2
1804 static int __Pyx_init_memviewslice(
1805  struct __pyx_memoryview_obj *memview,
1806  int ndim,
1807  __Pyx_memviewslice *memviewslice,
1808  int memview_is_new_reference);
1809 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1810  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1811 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1812  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1813 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1814 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1815 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1816 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1817 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1818 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1819 
1820 /* ArgTypeTest.proto */
1821 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1822  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1823  __Pyx__ArgTypeTest(obj, type, name, exact))
1824 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1825 
1826 /* UnicodeEquals.proto */
1827 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1828 
1829 /* StrEquals.proto */
1830 #if PY_MAJOR_VERSION >= 3
1831 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1832 #else
1833 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1834 #endif
1835 
1836 /* UnaryNegOverflows.proto */
1837 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1838  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1839 
1840 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1841 /* WriteUnraisableException.proto */
1842 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1843  int lineno, const char *filename,
1844  int full_traceback, int nogil);
1845 
1846 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1847 /* GetAttr.proto */
1848 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1849 
1850 /* ObjectGetItem.proto */
1851 #if CYTHON_USE_TYPE_SLOTS
1852 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1853 #else
1854 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1855 #endif
1856 
1857 /* decode_c_string_utf16.proto */
1858 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1859  int byteorder = 0;
1860  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1861 }
1862 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1863  int byteorder = -1;
1864  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1865 }
1866 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1867  int byteorder = 1;
1868  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1869 }
1870 
1871 /* decode_c_string.proto */
1872 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1873  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1874  const char* encoding, const char* errors,
1875  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1876 
1877 /* PyErrExceptionMatches.proto */
1878 #if CYTHON_FAST_THREAD_STATE
1879 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1880 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1881 #else
1882 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1883 #endif
1884 
1885 /* GetAttr3.proto */
1886 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1887 
1888 /* RaiseTooManyValuesToUnpack.proto */
1889 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1890 
1891 /* RaiseNeedMoreValuesToUnpack.proto */
1892 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1893 
1894 /* RaiseNoneIterError.proto */
1895 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1896 
1897 /* ExtTypeTest.proto */
1898 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1899 
1900 /* GetTopmostException.proto */
1901 #if CYTHON_USE_EXC_INFO_STACK
1902 static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
1903 #endif
1904 
1905 /* SaveResetException.proto */
1906 #if CYTHON_FAST_THREAD_STATE
1907 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1908 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1909 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1910 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1911 #else
1912 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1913 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1914 #endif
1915 
1916 /* GetException.proto */
1917 #if CYTHON_FAST_THREAD_STATE
1918 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1919 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1920 #else
1921 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1922 #endif
1923 
1924 /* SwapException.proto */
1925 #if CYTHON_FAST_THREAD_STATE
1926 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1927 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1928 #else
1929 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1930 #endif
1931 
1932 /* Import.proto */
1933 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1934 
1935 /* FastTypeChecks.proto */
1936 #if CYTHON_COMPILING_IN_CPYTHON
1937 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1938 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1939 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1940 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1941 #else
1942 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1943 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1944 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1945 #endif
1946 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1947 
1948 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1949 /* ListCompAppend.proto */
1950 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1951 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1952  PyListObject* L = (PyListObject*) list;
1953  Py_ssize_t len = Py_SIZE(list);
1954  if (likely(L->allocated > len)) {
1955  Py_INCREF(x);
1956  PyList_SET_ITEM(list, len, x);
1957  __Pyx_SET_SIZE(list, len + 1);
1958  return 0;
1959  }
1960  return PyList_Append(list, x);
1961 }
1962 #else
1963 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1964 #endif
1965 
1966 /* PyIntBinop.proto */
1967 #if !CYTHON_COMPILING_IN_PYPY
1968 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
1969 #else
1970 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
1971  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1972 #endif
1973 
1974 /* ListExtend.proto */
1975 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1976 #if CYTHON_COMPILING_IN_CPYTHON
1977  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1978  if (unlikely(!none))
1979  return -1;
1980  Py_DECREF(none);
1981  return 0;
1982 #else
1983  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1984 #endif
1985 }
1986 
1987 /* ListAppend.proto */
1988 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1989 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1990  PyListObject* L = (PyListObject*) list;
1991  Py_ssize_t len = Py_SIZE(list);
1992  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1993  Py_INCREF(x);
1994  PyList_SET_ITEM(list, len, x);
1995  __Pyx_SET_SIZE(list, len + 1);
1996  return 0;
1997  }
1998  return PyList_Append(list, x);
1999 }
2000 #else
2001 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2002 #endif
2003 
2004 /* None.proto */
2005 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2006 
2007 /* ImportFrom.proto */
2008 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2009 
2010 /* HasAttr.proto */
2011 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
2012 
2013 /* CallNextTpDealloc.proto */
2014 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc);
2015 
2016 /* CallNextTpTraverse.proto */
2017 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse);
2018 
2019 /* CallNextTpClear.proto */
2020 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_dealloc);
2021 
2022 /* PyObject_GenericGetAttrNoDict.proto */
2023 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2024 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
2025 #else
2026 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
2027 #endif
2028 
2029 /* PyObject_GenericGetAttr.proto */
2030 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
2031 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
2032 #else
2033 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
2034 #endif
2035 
2036 /* TypeImport.proto */
2037 #ifndef __PYX_HAVE_RT_ImportType_proto
2038 #define __PYX_HAVE_RT_ImportType_proto
2039 enum __Pyx_ImportType_CheckSize {
2040  __Pyx_ImportType_CheckSize_Error = 0,
2041  __Pyx_ImportType_CheckSize_Warn = 1,
2042  __Pyx_ImportType_CheckSize_Ignore = 2
2043 };
2044 static PyTypeObject *__Pyx_ImportType(PyObject* module, const char *module_name, const char *class_name, size_t size, enum __Pyx_ImportType_CheckSize check_size);
2045 #endif
2046 
2047 /* GetVTable.proto */
2048 static void* __Pyx_GetVtable(PyObject *dict);
2049 
2050 /* SetVTable.proto */
2051 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2052 
2053 /* PyObjectGetAttrStrNoError.proto */
2054 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);
2055 
2056 /* SetupReduce.proto */
2057 static int __Pyx_setup_reduce(PyObject* type_obj);
2058 
2059 /* FetchCommonType.proto */
2060 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2061 
2062 /* CythonFunctionShared.proto */
2063 #define __Pyx_CyFunction_USED 1
2064 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2065 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2066 #define __Pyx_CYFUNCTION_CCLASS 0x04
2067 #define __Pyx_CyFunction_GetClosure(f)\
2068  (((__pyx_CyFunctionObject *) (f))->func_closure)
2069 #define __Pyx_CyFunction_GetClassObj(f)\
2070  (((__pyx_CyFunctionObject *) (f))->func_classobj)
2071 #define __Pyx_CyFunction_Defaults(type, f)\
2072  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2073 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2074  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2075 typedef struct {
2076  PyCFunctionObject func;
2077 #if PY_VERSION_HEX < 0x030500A0
2078  PyObject *func_weakreflist;
2079 #endif
2080  PyObject *func_dict;
2081  PyObject *func_name;
2082  PyObject *func_qualname;
2083  PyObject *func_doc;
2084  PyObject *func_globals;
2085  PyObject *func_code;
2086  PyObject *func_closure;
2087  PyObject *func_classobj;
2088  void *defaults;
2089  int defaults_pyobjects;
2090  size_t defaults_size; // used by FusedFunction for copying defaults
2091  int flags;
2092  PyObject *defaults_tuple;
2093  PyObject *defaults_kwdict;
2094  PyObject *(*defaults_getter)(PyObject *);
2095  PyObject *func_annotations;
2096 } __pyx_CyFunctionObject;
2097 static PyTypeObject *__pyx_CyFunctionType = 0;
2098 #define __Pyx_CyFunction_Check(obj) (__Pyx_TypeCheck(obj, __pyx_CyFunctionType))
2099 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
2100  int flags, PyObject* qualname,
2101  PyObject *self,
2102  PyObject *module, PyObject *globals,
2103  PyObject* code);
2104 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2105  size_t size,
2106  int pyobjects);
2107 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2108  PyObject *tuple);
2109 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2110  PyObject *dict);
2111 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2112  PyObject *dict);
2113 static int __pyx_CyFunction_init(void);
2114 
2115 /* CythonFunction.proto */
2116 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
2117  int flags, PyObject* qualname,
2118  PyObject *closure,
2119  PyObject *module, PyObject *globals,
2120  PyObject* code);
2121 
2122 /* CLineInTraceback.proto */
2123 #ifdef CYTHON_CLINE_IN_TRACEBACK
2124 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
2125 #else
2126 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
2127 #endif
2128 
2129 /* CodeObjectCache.proto */
2130 typedef struct {
2131  PyCodeObject* code_object;
2132  int code_line;
2133 } __Pyx_CodeObjectCacheEntry;
2134 struct __Pyx_CodeObjectCache {
2135  int count;
2136  int max_count;
2137  __Pyx_CodeObjectCacheEntry* entries;
2138 };
2139 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2140 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2141 static PyCodeObject *__pyx_find_code_object(int code_line);
2142 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2143 
2144 /* AddTraceback.proto */
2145 static void __Pyx_AddTraceback(const char *funcname, int c_line,
2146  int py_line, const char *filename);
2147 
2148 #if PY_MAJOR_VERSION < 3
2149  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
2150  static void __Pyx_ReleaseBuffer(Py_buffer *view);
2151 #else
2152  #define __Pyx_GetBuffer PyObject_GetBuffer
2153  #define __Pyx_ReleaseBuffer PyBuffer_Release
2154 #endif
2155 
2156 
2157 /* BufferStructDeclare.proto */
2158 typedef struct {
2159  Py_ssize_t shape, strides, suboffsets;
2160 } __Pyx_Buf_DimInfo;
2161 typedef struct {
2162  size_t refcount;
2163  Py_buffer pybuffer;
2164 } __Pyx_Buffer;
2165 typedef struct {
2166  __Pyx_Buffer *rcbuffer;
2167  char *data;
2168  __Pyx_Buf_DimInfo diminfo[8];
2169 } __Pyx_LocalBuf_ND;
2170 
2171 /* MemviewSliceIsContig.proto */
2172 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
2173 
2174 /* OverlappingSlices.proto */
2175 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
2176  __Pyx_memviewslice *slice2,
2177  int ndim, size_t itemsize);
2178 
2179 /* Capsule.proto */
2180 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
2181 
2182 /* GCCDiagnostics.proto */
2183 #if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
2184 #define __Pyx_HAS_GCC_DIAGNOSTIC
2185 #endif
2186 
2187 /* IsLittleEndian.proto */
2188 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
2189 
2190 /* BufferFormatCheck.proto */
2191 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
2192 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
2193  __Pyx_BufFmt_StackElem* stack,
2194  __Pyx_TypeInfo* type);
2195 
2196 /* TypeInfoCompare.proto */
2197 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
2198 
2199 /* MemviewSliceValidateAndInit.proto */
2200 static int __Pyx_ValidateAndInit_memviewslice(
2201  int *axes_specs,
2202  int c_or_f_flag,
2203  int buf_flags,
2204  int ndim,
2205  __Pyx_TypeInfo *dtype,
2206  __Pyx_BufFmt_StackElem stack[],
2207  __Pyx_memviewslice *memviewslice,
2208  PyObject *original_obj);
2209 
2210 /* ObjectToMemviewSlice.proto */
2211 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *, int writable_flag);
2212 
2213 /* ObjectToMemviewSlice.proto */
2214 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *, int writable_flag);
2215 
2216 /* CppExceptionConversion.proto */
2217 #ifndef __Pyx_CppExn2PyErr
2218 #include <new>
2219 #include <typeinfo>
2220 #include <stdexcept>
2221 #include <ios>
2222 static void __Pyx_CppExn2PyErr() {
2223  try {
2224  if (PyErr_Occurred())
2225  ; // let the latest Python exn pass through and ignore the current one
2226  else
2227  throw;
2228  } catch (const std::bad_alloc& exn) {
2229  PyErr_SetString(PyExc_MemoryError, exn.what());
2230  } catch (const std::bad_cast& exn) {
2231  PyErr_SetString(PyExc_TypeError, exn.what());
2232  } catch (const std::bad_typeid& exn) {
2233  PyErr_SetString(PyExc_TypeError, exn.what());
2234  } catch (const std::domain_error& exn) {
2235  PyErr_SetString(PyExc_ValueError, exn.what());
2236  } catch (const std::invalid_argument& exn) {
2237  PyErr_SetString(PyExc_ValueError, exn.what());
2238  } catch (const std::ios_base::failure& exn) {
2239  PyErr_SetString(PyExc_IOError, exn.what());
2240  } catch (const std::out_of_range& exn) {
2241  PyErr_SetString(PyExc_IndexError, exn.what());
2242  } catch (const std::overflow_error& exn) {
2243  PyErr_SetString(PyExc_OverflowError, exn.what());
2244  } catch (const std::range_error& exn) {
2245  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2246  } catch (const std::underflow_error& exn) {
2247  PyErr_SetString(PyExc_ArithmeticError, exn.what());
2248  } catch (const std::exception& exn) {
2249  PyErr_SetString(PyExc_RuntimeError, exn.what());
2250  }
2251  catch (...)
2252  {
2253  PyErr_SetString(PyExc_RuntimeError, "Unknown exception");
2254  }
2255 }
2256 #endif
2257 
2258 /* ObjectToMemviewSlice.proto */
2259 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *, int writable_flag);
2260 
2261 /* ObjectToMemviewSlice.proto */
2262 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *, int writable_flag);
2263 
2264 /* ObjectToMemviewSlice.proto */
2265 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *, int writable_flag);
2266 
2267 /* ObjectToMemviewSlice.proto */
2268 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *, int writable_flag);
2269 
2270 /* ObjectToMemviewSlice.proto */
2271 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
2272 
2273 /* ObjectToMemviewSlice.proto */
2274 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *, int writable_flag);
2275 
2276 /* ObjectToMemviewSlice.proto */
2277 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
2278 
2279 /* ObjectToMemviewSlice.proto */
2280 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *, int writable_flag);
2281 
2282 /* MemviewSliceCopyTemplate.proto */
2283 static __Pyx_memviewslice
2284 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2285  const char *mode, int ndim,
2286  size_t sizeof_dtype, int contig_flag,
2287  int dtype_is_object);
2288 
2289 /* CIntToPy.proto */
2290 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2291 
2292 /* CIntFromPy.proto */
2293 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2294 
2295 /* CIntFromPy.proto */
2296 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2297 
2298 /* CIntToPy.proto */
2299 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2300 
2301 /* CIntFromPy.proto */
2302 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2303 
2304 /* CheckBinaryVersion.proto */
2305 static int __Pyx_check_binary_version(void);
2306 
2307 /* InitStrings.proto */
2308 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2309 
2310 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2311 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2312 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2313 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2314 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2315 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2316 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2317 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2318 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2319 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2320 
2321 /* Module declarations from 'imate._definitions.types' */
2322 
2323 /* Module declarations from 'imate._c_linear_operator.c_linear_operator' */
2324 
2325 /* Module declarations from 'imate._c_linear_operator.py_c_linear_operator' */
2326 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = 0;
2327 
2328 /* Module declarations from 'imate._c_linear_operator.c_matrix' */
2329 
2330 /* Module declarations from 'imate._c_linear_operator.c_dense_matrix' */
2331 
2332 /* Module declarations from 'imate._c_linear_operator.c_csr_matrix' */
2333 
2334 /* Module declarations from 'imate._c_linear_operator.c_csc_matrix' */
2335 
2336 /* Module declarations from 'imate._c_linear_operator.py_c_matrix' */
2337 static PyTypeObject *__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = 0;
2338 static PyTypeObject *__pyx_array_type = 0;
2339 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2340 static PyTypeObject *__pyx_memoryview_type = 0;
2341 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2342 static PyObject *generic = 0;
2343 static PyObject *strided = 0;
2344 static PyObject *indirect = 0;
2345 static PyObject *contiguous = 0;
2346 static PyObject *indirect_contiguous = 0;
2347 static int __pyx_memoryview_thread_locks_used;
2348 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2349 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2350 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2351 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2352 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2353 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2354 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2355 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2356 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2357 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2358 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2359 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2360 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2361 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2362 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2363 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2364 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2365 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2366 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2367 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2368 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2369 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2370 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2371 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2372 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2373 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2374 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2375 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2376 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2377 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2378 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2379 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2380 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2381 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2382 static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
2383 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2384 static __Pyx_TypeInfo __Pyx_TypeInfo_long__double = { "long double", NULL, sizeof(long double), { 0 }, 0, 'R', 0, 0 };
2385 static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
2386 #define __Pyx_MODULE_NAME "imate._c_linear_operator.py_c_matrix"
2387 extern int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix;
2388 int __pyx_module_is_main_imate___c_linear_operator__py_c_matrix = 0;
2389 
2390 /* Implementation of 'imate._c_linear_operator.py_c_matrix' */
2391 static PyObject *__pyx_builtin_ValueError;
2392 static PyObject *__pyx_builtin_TypeError;
2393 static PyObject *__pyx_builtin_MemoryError;
2394 static PyObject *__pyx_builtin_enumerate;
2395 static PyObject *__pyx_builtin_range;
2396 static PyObject *__pyx_builtin_Ellipsis;
2397 static PyObject *__pyx_builtin_id;
2398 static PyObject *__pyx_builtin_IndexError;
2399 static const char __pyx_k_A[] = "A";
2400 static const char __pyx_k_O[] = "O";
2401 static const char __pyx_k_c[] = "c";
2402 static const char __pyx_k_id[] = "id";
2403 static const char __pyx_k_new[] = "__new__";
2404 static const char __pyx_k_obj[] = "obj";
2405 static const char __pyx_k_base[] = "base";
2406 static const char __pyx_k_copy[] = "copy";
2407 static const char __pyx_k_data[] = "data";
2408 static const char __pyx_k_dict[] = "__dict__";
2409 static const char __pyx_k_main[] = "__main__";
2410 static const char __pyx_k_mode[] = "mode";
2411 static const char __pyx_k_name[] = "name";
2412 static const char __pyx_k_ndim[] = "ndim";
2413 static const char __pyx_k_pack[] = "pack";
2414 static const char __pyx_k_self[] = "self";
2415 static const char __pyx_k_size[] = "size";
2416 static const char __pyx_k_step[] = "step";
2417 static const char __pyx_k_stop[] = "stop";
2418 static const char __pyx_k_test[] = "__test__";
2419 static const char __pyx_k_ASCII[] = "ASCII";
2420 static const char __pyx_k_class[] = "__class__";
2421 static const char __pyx_k_dtype[] = "dtype";
2422 static const char __pyx_k_error[] = "error";
2423 static const char __pyx_k_flags[] = "flags";
2424 static const char __pyx_k_numpy[] = "numpy";
2425 static const char __pyx_k_range[] = "range";
2426 static const char __pyx_k_shape[] = "shape";
2427 static const char __pyx_k_start[] = "start";
2428 static const char __pyx_k_astype[] = "astype";
2429 static const char __pyx_k_encode[] = "encode";
2430 static const char __pyx_k_format[] = "format";
2431 static const char __pyx_k_import[] = "__import__";
2432 static const char __pyx_k_indptr[] = "indptr";
2433 static const char __pyx_k_name_2[] = "__name__";
2434 static const char __pyx_k_pickle[] = "pickle";
2435 static const char __pyx_k_reduce[] = "__reduce__";
2436 static const char __pyx_k_struct[] = "struct";
2437 static const char __pyx_k_unpack[] = "unpack";
2438 static const char __pyx_k_update[] = "update";
2439 static const char __pyx_k_float32[] = "float32";
2440 static const char __pyx_k_float64[] = "float64";
2441 static const char __pyx_k_fortran[] = "fortran";
2442 static const char __pyx_k_indices[] = "indices";
2443 static const char __pyx_k_memview[] = "memview";
2444 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2445 static const char __pyx_k_float128[] = "float128";
2446 static const char __pyx_k_getstate[] = "__getstate__";
2447 static const char __pyx_k_issparse[] = "issparse";
2448 static const char __pyx_k_itemsize[] = "itemsize";
2449 static const char __pyx_k_pyx_type[] = "__pyx_type";
2450 static const char __pyx_k_setstate[] = "__setstate__";
2451 static const char __pyx_k_A_indices[] = "A_indices";
2452 static const char __pyx_k_TypeError[] = "TypeError";
2453 static const char __pyx_k_enumerate[] = "enumerate";
2454 static const char __pyx_k_pycMatrix[] = "pycMatrix";
2455 static const char __pyx_k_pyx_state[] = "__pyx_state";
2456 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2457 static const char __pyx_k_A_num_rows[] = "A_num_rows";
2458 static const char __pyx_k_IndexError[] = "IndexError";
2459 static const char __pyx_k_ValueError[] = "ValueError";
2460 static const char __pyx_k_csr_matrix[] = "csr_matrix";
2461 static const char __pyx_k_pyx_result[] = "__pyx_result";
2462 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2463 static const char __pyx_k_MemoryError[] = "MemoryError";
2464 static const char __pyx_k_PickleError[] = "PickleError";
2465 static const char __pyx_k_A_data_float[] = "A_data_float";
2466 static const char __pyx_k_A_indices_mv[] = "A_indices_mv";
2467 static const char __pyx_k_C_CONTIGUOUS[] = "C_CONTIGUOUS";
2468 static const char __pyx_k_F_CONTIGUOUS[] = "F_CONTIGUOUS";
2469 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2470 static const char __pyx_k_scipy_sparse[] = "scipy.sparse";
2471 static const char __pyx_k_sort_indices[] = "sort_indices";
2472 static const char __pyx_k_stringsource[] = "stringsource";
2473 static const char __pyx_k_A_data_double[] = "A_data_double";
2474 static const char __pyx_k_A_num_columns[] = "A_num_columns";
2475 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2476 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2477 static const char __pyx_k_A_is_row_major[] = "A_is_row_major";
2478 static const char __pyx_k_isspmatrix_csc[] = "isspmatrix_csc";
2479 static const char __pyx_k_isspmatrix_csr[] = "isspmatrix_csr";
2480 static const char __pyx_k_A_data_float_mv[] = "A_data_float_mv";
2481 static const char __pyx_k_A_index_pointer[] = "A_index_pointer";
2482 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2483 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2484 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2485 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2486 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2487 static const char __pyx_k_A_cannot_be_None[] = "A cannot be None.";
2488 static const char __pyx_k_A_data_double_mv[] = "A_data_double_mv";
2489 static const char __pyx_k_A_data_float_mv_c[] = "A_data_float_mv_c";
2490 static const char __pyx_k_A_data_float_mv_f[] = "A_data_float_mv_f";
2491 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2492 static const char __pyx_k_A_data_double_mv_c[] = "A_data_double_mv_c";
2493 static const char __pyx_k_A_data_double_mv_f[] = "A_data_double_mv_f";
2494 static const char __pyx_k_A_data_long_double[] = "A_data_long_double";
2495 static const char __pyx_k_A_index_pointer_mv[] = "A_index_pointer_mv";
2496 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2497 static const char __pyx_k_has_sorted_indices[] = "has_sorted_indices";
2498 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2499 static const char __pyx_k_set_csc_matrix_float[] = "set_csc_matrix_float";
2500 static const char __pyx_k_set_csr_matrix_float[] = "set_csr_matrix_float";
2501 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2502 static const char __pyx_k_A_data_long_double_mv[] = "A_data_long_double_mv";
2503 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2504 static const char __pyx_k_set_csc_matrix_double[] = "set_csc_matrix_double";
2505 static const char __pyx_k_set_csr_matrix_double[] = "set_csr_matrix_double";
2506 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2507 static const char __pyx_k_set_dense_matrix_float[] = "set_dense_matrix_float";
2508 static const char __pyx_k_A_data_long_double_mv_c[] = "A_data_long_double_mv_c";
2509 static const char __pyx_k_A_data_long_double_mv_f[] = "A_data_long_double_mv_f";
2510 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2511 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2512 static const char __pyx_k_set_dense_matrix_double[] = "set_dense_matrix_double";
2513 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2514 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2515 static const char __pyx_k_pycMatrix___reduce_cython[] = "pycMatrix.__reduce_cython__";
2516 static const char __pyx_k_set_csc_matrix_long_double[] = "set_csc_matrix_long_double";
2517 static const char __pyx_k_set_csr_matrix_long_double[] = "set_csr_matrix_long_double";
2518 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2519 static const char __pyx_k_pycMatrix___setstate_cython[] = "pycMatrix.__setstate_cython__";
2520 static const char __pyx_k_set_dense_matrix_long_double[] = "set_dense_matrix_long_double";
2521 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2522 static const char __pyx_k_pycMatrix_set_csc_matrix_float[] = "pycMatrix.set_csc_matrix_float";
2523 static const char __pyx_k_pycMatrix_set_csr_matrix_float[] = "pycMatrix.set_csr_matrix_float";
2524 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2525 static const char __pyx_k_pycMatrix_set_csc_matrix_double[] = "pycMatrix.set_csc_matrix_double";
2526 static const char __pyx_k_pycMatrix_set_csr_matrix_double[] = "pycMatrix.set_csr_matrix_double";
2527 static const char __pyx_k_pycMatrix_set_dense_matrix_long[] = "pycMatrix.set_dense_matrix_long_double";
2528 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2529 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2530 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2531 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2532 static const char __pyx_k_Data_type_should_be_float32_floa[] = "Data type should be \"float32\", \"float64\", or \"float128\".";
2533 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2534 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2535 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2536 static const char __pyx_k_Input_matrix_should_be_a_2_dimen[] = "Input matrix should be a 2-dimensional array.";
2537 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2538 static const char __pyx_k_Matrix_A_should_be_either_C_or_F[] = "Matrix A should be either C or F contiguous.";
2539 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2540 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2541 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2542 static const char __pyx_k_imate__c_linear_operator_py_c_ma[] = "imate/_c_linear_operator/py_c_matrix.pyx";
2543 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2544 static const char __pyx_k_pycMatrix_set_csc_matrix_long_do[] = "pycMatrix.set_csc_matrix_long_double";
2545 static const char __pyx_k_pycMatrix_set_csr_matrix_long_do[] = "pycMatrix.set_csr_matrix_long_double";
2546 static const char __pyx_k_pycMatrix_set_dense_matrix_doubl[] = "pycMatrix.set_dense_matrix_double";
2547 static const char __pyx_k_pycMatrix_set_dense_matrix_float[] = "pycMatrix.set_dense_matrix_float";
2548 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2549 static const char __pyx_k_imate__c_linear_operator_py_c_ma_2[] = "imate._c_linear_operator.py_c_matrix";
2550 static PyObject *__pyx_n_s_A;
2551 static PyObject *__pyx_n_s_ASCII;
2552 static PyObject *__pyx_kp_u_A_cannot_be_None;
2553 static PyObject *__pyx_n_s_A_data_double;
2554 static PyObject *__pyx_n_s_A_data_double_mv;
2555 static PyObject *__pyx_n_s_A_data_double_mv_c;
2556 static PyObject *__pyx_n_s_A_data_double_mv_f;
2557 static PyObject *__pyx_n_s_A_data_float;
2558 static PyObject *__pyx_n_s_A_data_float_mv;
2559 static PyObject *__pyx_n_s_A_data_float_mv_c;
2560 static PyObject *__pyx_n_s_A_data_float_mv_f;
2561 static PyObject *__pyx_n_s_A_data_long_double;
2562 static PyObject *__pyx_n_s_A_data_long_double_mv;
2563 static PyObject *__pyx_n_s_A_data_long_double_mv_c;
2564 static PyObject *__pyx_n_s_A_data_long_double_mv_f;
2565 static PyObject *__pyx_n_s_A_index_pointer;
2566 static PyObject *__pyx_n_s_A_index_pointer_mv;
2567 static PyObject *__pyx_n_s_A_indices;
2568 static PyObject *__pyx_n_s_A_indices_mv;
2569 static PyObject *__pyx_n_s_A_is_row_major;
2570 static PyObject *__pyx_n_s_A_num_columns;
2571 static PyObject *__pyx_n_s_A_num_rows;
2572 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2573 static PyObject *__pyx_n_u_C_CONTIGUOUS;
2574 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2575 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2576 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2577 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2578 static PyObject *__pyx_kp_u_Data_type_should_be_float32_floa;
2579 static PyObject *__pyx_n_s_Ellipsis;
2580 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2581 static PyObject *__pyx_n_u_F_CONTIGUOUS;
2582 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2583 static PyObject *__pyx_n_s_IndexError;
2584 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2585 static PyObject *__pyx_kp_u_Input_matrix_should_be_a_2_dimen;
2586 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2587 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2588 static PyObject *__pyx_kp_u_Matrix_A_should_be_either_C_or_F;
2589 static PyObject *__pyx_n_s_MemoryError;
2590 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2591 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2592 static PyObject *__pyx_n_b_O;
2593 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2594 static PyObject *__pyx_n_s_PickleError;
2595 static PyObject *__pyx_n_s_TypeError;
2596 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2597 static PyObject *__pyx_n_s_ValueError;
2598 static PyObject *__pyx_n_s_View_MemoryView;
2599 static PyObject *__pyx_n_s_allocate_buffer;
2600 static PyObject *__pyx_n_s_astype;
2601 static PyObject *__pyx_n_s_base;
2602 static PyObject *__pyx_n_s_c;
2603 static PyObject *__pyx_n_u_c;
2604 static PyObject *__pyx_n_s_class;
2605 static PyObject *__pyx_n_s_cline_in_traceback;
2606 static PyObject *__pyx_kp_s_contiguous_and_direct;
2607 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2608 static PyObject *__pyx_n_s_copy;
2609 static PyObject *__pyx_n_s_csr_matrix;
2610 static PyObject *__pyx_n_s_data;
2611 static PyObject *__pyx_n_s_dict;
2612 static PyObject *__pyx_n_s_dtype;
2613 static PyObject *__pyx_n_s_dtype_is_object;
2614 static PyObject *__pyx_n_s_encode;
2615 static PyObject *__pyx_n_s_enumerate;
2616 static PyObject *__pyx_n_s_error;
2617 static PyObject *__pyx_n_s_flags;
2618 static PyObject *__pyx_n_b_float128;
2619 static PyObject *__pyx_n_b_float32;
2620 static PyObject *__pyx_n_b_float64;
2621 static PyObject *__pyx_n_s_format;
2622 static PyObject *__pyx_n_s_fortran;
2623 static PyObject *__pyx_n_u_fortran;
2624 static PyObject *__pyx_n_s_getstate;
2625 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2626 static PyObject *__pyx_n_s_has_sorted_indices;
2627 static PyObject *__pyx_n_s_id;
2628 static PyObject *__pyx_kp_s_imate__c_linear_operator_py_c_ma;
2629 static PyObject *__pyx_n_s_imate__c_linear_operator_py_c_ma_2;
2630 static PyObject *__pyx_n_s_import;
2631 static PyObject *__pyx_n_s_indices;
2632 static PyObject *__pyx_n_s_indptr;
2633 static PyObject *__pyx_n_s_issparse;
2634 static PyObject *__pyx_n_s_isspmatrix_csc;
2635 static PyObject *__pyx_n_s_isspmatrix_csr;
2636 static PyObject *__pyx_n_s_itemsize;
2637 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2638 static PyObject *__pyx_n_s_main;
2639 static PyObject *__pyx_n_s_memview;
2640 static PyObject *__pyx_n_s_mode;
2641 static PyObject *__pyx_n_s_name;
2642 static PyObject *__pyx_n_s_name_2;
2643 static PyObject *__pyx_n_s_ndim;
2644 static PyObject *__pyx_n_s_new;
2645 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2646 static PyObject *__pyx_n_s_numpy;
2647 static PyObject *__pyx_n_s_obj;
2648 static PyObject *__pyx_n_s_pack;
2649 static PyObject *__pyx_n_s_pickle;
2650 static PyObject *__pyx_n_s_pycMatrix;
2651 static PyObject *__pyx_n_s_pycMatrix___reduce_cython;
2652 static PyObject *__pyx_n_s_pycMatrix___setstate_cython;
2653 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_double;
2654 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_float;
2655 static PyObject *__pyx_n_s_pycMatrix_set_csc_matrix_long_do;
2656 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_double;
2657 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_float;
2658 static PyObject *__pyx_n_s_pycMatrix_set_csr_matrix_long_do;
2659 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_doubl;
2660 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_float;
2661 static PyObject *__pyx_n_s_pycMatrix_set_dense_matrix_long;
2662 static PyObject *__pyx_n_s_pyx_PickleError;
2663 static PyObject *__pyx_n_s_pyx_checksum;
2664 static PyObject *__pyx_n_s_pyx_getbuffer;
2665 static PyObject *__pyx_n_s_pyx_result;
2666 static PyObject *__pyx_n_s_pyx_state;
2667 static PyObject *__pyx_n_s_pyx_type;
2668 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2669 static PyObject *__pyx_n_s_pyx_vtable;
2670 static PyObject *__pyx_n_s_range;
2671 static PyObject *__pyx_n_s_reduce;
2672 static PyObject *__pyx_n_s_reduce_cython;
2673 static PyObject *__pyx_n_s_reduce_ex;
2674 static PyObject *__pyx_n_s_scipy_sparse;
2675 static PyObject *__pyx_n_s_self;
2676 static PyObject *__pyx_n_s_set_csc_matrix_double;
2677 static PyObject *__pyx_n_s_set_csc_matrix_float;
2678 static PyObject *__pyx_n_s_set_csc_matrix_long_double;
2679 static PyObject *__pyx_n_s_set_csr_matrix_double;
2680 static PyObject *__pyx_n_s_set_csr_matrix_float;
2681 static PyObject *__pyx_n_s_set_csr_matrix_long_double;
2682 static PyObject *__pyx_n_s_set_dense_matrix_double;
2683 static PyObject *__pyx_n_s_set_dense_matrix_float;
2684 static PyObject *__pyx_n_s_set_dense_matrix_long_double;
2685 static PyObject *__pyx_n_s_setstate;
2686 static PyObject *__pyx_n_s_setstate_cython;
2687 static PyObject *__pyx_n_s_shape;
2688 static PyObject *__pyx_n_s_size;
2689 static PyObject *__pyx_n_s_sort_indices;
2690 static PyObject *__pyx_n_s_start;
2691 static PyObject *__pyx_n_s_step;
2692 static PyObject *__pyx_n_s_stop;
2693 static PyObject *__pyx_kp_s_strided_and_direct;
2694 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2695 static PyObject *__pyx_kp_s_strided_and_indirect;
2696 static PyObject *__pyx_kp_s_stringsource;
2697 static PyObject *__pyx_n_s_struct;
2698 static PyObject *__pyx_n_s_test;
2699 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2700 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2701 static PyObject *__pyx_n_s_unpack;
2702 static PyObject *__pyx_n_s_update;
2703 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2704 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2705 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2706 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2707 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2708 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2709 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2710 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2711 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2712 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A); /* proto */
2713 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self); /* proto */
2714 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2715 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2716 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2717 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2718 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2719 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2720 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2721 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2722 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2723 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2724 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2725 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2726 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2727 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2728 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2729 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2730 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2731 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2732 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2733 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2734 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2735 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2736 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2737 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2738 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2739 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2740 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2741 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2742 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2743 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2744 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2745 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2746 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2747 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2748 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2749 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2750 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2751 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2752 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2753 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2754 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2755 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2756 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2757 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2758 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2759 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2760 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2761 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2762 static PyObject *__pyx_int_0;
2763 static PyObject *__pyx_int_1;
2764 static PyObject *__pyx_int_2;
2765 static PyObject *__pyx_int_184977713;
2766 static PyObject *__pyx_int_neg_1;
2767 static PyObject *__pyx_tuple_;
2768 static PyObject *__pyx_tuple__2;
2769 static PyObject *__pyx_tuple__3;
2770 static PyObject *__pyx_tuple__5;
2771 static PyObject *__pyx_slice__32;
2772 static PyObject *__pyx_tuple__15;
2773 static PyObject *__pyx_tuple__17;
2774 static PyObject *__pyx_tuple__18;
2775 static PyObject *__pyx_tuple__19;
2776 static PyObject *__pyx_tuple__20;
2777 static PyObject *__pyx_tuple__21;
2778 static PyObject *__pyx_tuple__22;
2779 static PyObject *__pyx_tuple__23;
2780 static PyObject *__pyx_tuple__24;
2781 static PyObject *__pyx_tuple__25;
2782 static PyObject *__pyx_tuple__26;
2783 static PyObject *__pyx_tuple__27;
2784 static PyObject *__pyx_tuple__28;
2785 static PyObject *__pyx_tuple__29;
2786 static PyObject *__pyx_tuple__30;
2787 static PyObject *__pyx_tuple__31;
2788 static PyObject *__pyx_tuple__33;
2789 static PyObject *__pyx_tuple__34;
2790 static PyObject *__pyx_tuple__35;
2791 static PyObject *__pyx_tuple__37;
2792 static PyObject *__pyx_tuple__38;
2793 static PyObject *__pyx_tuple__39;
2794 static PyObject *__pyx_tuple__40;
2795 static PyObject *__pyx_tuple__41;
2796 static PyObject *__pyx_tuple__42;
2797 static PyObject *__pyx_tuple__43;
2798 static PyObject *__pyx_tuple__44;
2799 static PyObject *__pyx_tuple__45;
2800 static PyObject *__pyx_tuple__46;
2801 static PyObject *__pyx_tuple__47;
2802 static PyObject *__pyx_tuple__48;
2803 static PyObject *__pyx_tuple__49;
2804 static PyObject *__pyx_tuple__50;
2805 static PyObject *__pyx_tuple__51;
2806 static PyObject *__pyx_tuple__52;
2807 static PyObject *__pyx_tuple__53;
2808 static PyObject *__pyx_codeobj__4;
2809 static PyObject *__pyx_codeobj__6;
2810 static PyObject *__pyx_codeobj__7;
2811 static PyObject *__pyx_codeobj__8;
2812 static PyObject *__pyx_codeobj__9;
2813 static PyObject *__pyx_codeobj__10;
2814 static PyObject *__pyx_codeobj__11;
2815 static PyObject *__pyx_codeobj__12;
2816 static PyObject *__pyx_codeobj__13;
2817 static PyObject *__pyx_codeobj__14;
2818 static PyObject *__pyx_codeobj__16;
2819 static PyObject *__pyx_codeobj__36;
2820 /* Late includes */
2821 
2822 /* "imate/_c_linear_operator/py_c_matrix.pyx":119
2823  * # =========
2824  *
2825  * def __cinit__(self, A): # <<<<<<<<<<<<<<
2826  * """
2827  * Sets the matrix A.
2828  */
2829 
2830 /* Python wrapper */
2831 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2832 static int __pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2833  PyObject *__pyx_v_A = 0;
2834  int __pyx_lineno = 0;
2835  const char *__pyx_filename = NULL;
2836  int __pyx_clineno = 0;
2837  int __pyx_r;
2838  __Pyx_RefNannyDeclarations
2839  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2840  {
2841  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_A,0};
2842  PyObject* values[1] = {0};
2843  if (unlikely(__pyx_kwds)) {
2844  Py_ssize_t kw_args;
2845  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2846  switch (pos_args) {
2847  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2848  CYTHON_FALLTHROUGH;
2849  case 0: break;
2850  default: goto __pyx_L5_argtuple_error;
2851  }
2852  kw_args = PyDict_Size(__pyx_kwds);
2853  switch (pos_args) {
2854  case 0:
2855  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_A)) != 0)) kw_args--;
2856  else goto __pyx_L5_argtuple_error;
2857  }
2858  if (unlikely(kw_args > 0)) {
2859  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 119, __pyx_L3_error)
2860  }
2861  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
2862  goto __pyx_L5_argtuple_error;
2863  } else {
2864  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2865  }
2866  __pyx_v_A = values[0];
2867  }
2868  goto __pyx_L4_argument_unpacking_done;
2869  __pyx_L5_argtuple_error:;
2870  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 119, __pyx_L3_error)
2871  __pyx_L3_error:;
2872  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2873  __Pyx_RefNannyFinishContext();
2874  return -1;
2875  __pyx_L4_argument_unpacking_done:;
2876  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), __pyx_v_A);
2877 
2878  /* function exit code */
2879  __Pyx_RefNannyFinishContext();
2880  return __pyx_r;
2881 }
2882 
2883 static int __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix___cinit__(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
2884  int __pyx_r;
2885  __Pyx_TraceDeclarations
2886  __Pyx_RefNannyDeclarations
2887  int __pyx_t_1;
2888  int __pyx_t_2;
2889  PyObject *__pyx_t_3 = NULL;
2890  PyObject *__pyx_t_4 = NULL;
2891  PyObject *__pyx_t_5 = NULL;
2892  int __pyx_lineno = 0;
2893  const char *__pyx_filename = NULL;
2894  int __pyx_clineno = 0;
2895  __Pyx_RefNannySetupContext("__cinit__", 0);
2896  __Pyx_TraceCall("__cinit__", __pyx_f[0], 119, 0, __PYX_ERR(0, 119, __pyx_L1_error));
2897 
2898  /* "imate/_c_linear_operator/py_c_matrix.pyx":125
2899  *
2900  * # Check A
2901  * if A is None: # <<<<<<<<<<<<<<
2902  * raise ValueError('A cannot be None.')
2903  *
2904  */
2905  __Pyx_TraceLine(125,0,__PYX_ERR(0, 125, __pyx_L1_error))
2906  __pyx_t_1 = (__pyx_v_A == Py_None);
2907  __pyx_t_2 = (__pyx_t_1 != 0);
2908  if (unlikely(__pyx_t_2)) {
2909 
2910  /* "imate/_c_linear_operator/py_c_matrix.pyx":126
2911  * # Check A
2912  * if A is None:
2913  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
2914  *
2915  * if A.ndim != 2:
2916  */
2917  __Pyx_TraceLine(126,0,__PYX_ERR(0, 126, __pyx_L1_error))
2918  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 126, __pyx_L1_error)
2919  __Pyx_GOTREF(__pyx_t_3);
2920  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
2921  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2922  __PYX_ERR(0, 126, __pyx_L1_error)
2923 
2924  /* "imate/_c_linear_operator/py_c_matrix.pyx":125
2925  *
2926  * # Check A
2927  * if A is None: # <<<<<<<<<<<<<<
2928  * raise ValueError('A cannot be None.')
2929  *
2930  */
2931  }
2932 
2933  /* "imate/_c_linear_operator/py_c_matrix.pyx":128
2934  * raise ValueError('A cannot be None.')
2935  *
2936  * if A.ndim != 2: # <<<<<<<<<<<<<<
2937  * raise ValueError('Input matrix should be a 2-dimensional array.')
2938  *
2939  */
2940  __Pyx_TraceLine(128,0,__PYX_ERR(0, 128, __pyx_L1_error))
2941  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 128, __pyx_L1_error)
2942  __Pyx_GOTREF(__pyx_t_3);
2943  __pyx_t_4 = __Pyx_PyInt_NeObjC(__pyx_t_3, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 128, __pyx_L1_error)
2944  __Pyx_GOTREF(__pyx_t_4);
2945  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
2946  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 128, __pyx_L1_error)
2947  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2948  if (unlikely(__pyx_t_2)) {
2949 
2950  /* "imate/_c_linear_operator/py_c_matrix.pyx":129
2951  *
2952  * if A.ndim != 2:
2953  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
2954  *
2955  * # Data type
2956  */
2957  __Pyx_TraceLine(129,0,__PYX_ERR(0, 129, __pyx_L1_error))
2958  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 129, __pyx_L1_error)
2959  __Pyx_GOTREF(__pyx_t_4);
2960  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
2961  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2962  __PYX_ERR(0, 129, __pyx_L1_error)
2963 
2964  /* "imate/_c_linear_operator/py_c_matrix.pyx":128
2965  * raise ValueError('A cannot be None.')
2966  *
2967  * if A.ndim != 2: # <<<<<<<<<<<<<<
2968  * raise ValueError('Input matrix should be a 2-dimensional array.')
2969  *
2970  */
2971  }
2972 
2973  /* "imate/_c_linear_operator/py_c_matrix.pyx":132
2974  *
2975  * # Data type
2976  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
2977  * self.data_type_name = b'float32'
2978  *
2979  */
2980  __Pyx_TraceLine(132,0,__PYX_ERR(0, 132, __pyx_L1_error))
2981  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 132, __pyx_L1_error)
2982  __Pyx_GOTREF(__pyx_t_4);
2983  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 132, __pyx_L1_error)
2984  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2985  if (__pyx_t_2) {
2986 
2987  /* "imate/_c_linear_operator/py_c_matrix.pyx":133
2988  * # Data type
2989  * if A.dtype == b'float32':
2990  * self.data_type_name = b'float32' # <<<<<<<<<<<<<<
2991  *
2992  * elif A.dtype == b'float64':
2993  */
2994  __Pyx_TraceLine(133,0,__PYX_ERR(0, 133, __pyx_L1_error))
2995  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float32");
2996 
2997  /* "imate/_c_linear_operator/py_c_matrix.pyx":132
2998  *
2999  * # Data type
3000  * if A.dtype == b'float32': # <<<<<<<<<<<<<<
3001  * self.data_type_name = b'float32'
3002  *
3003  */
3004  goto __pyx_L5;
3005  }
3006 
3007  /* "imate/_c_linear_operator/py_c_matrix.pyx":135
3008  * self.data_type_name = b'float32'
3009  *
3010  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3011  * self.data_type_name = b'float64'
3012  *
3013  */
3014  __Pyx_TraceLine(135,0,__PYX_ERR(0, 135, __pyx_L1_error))
3015  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 135, __pyx_L1_error)
3016  __Pyx_GOTREF(__pyx_t_4);
3017  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 135, __pyx_L1_error)
3018  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3019  if (__pyx_t_2) {
3020 
3021  /* "imate/_c_linear_operator/py_c_matrix.pyx":136
3022  *
3023  * elif A.dtype == b'float64':
3024  * self.data_type_name = b'float64' # <<<<<<<<<<<<<<
3025  *
3026  * elif A.dtype == b'float128':
3027  */
3028  __Pyx_TraceLine(136,0,__PYX_ERR(0, 136, __pyx_L1_error))
3029  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float64");
3030 
3031  /* "imate/_c_linear_operator/py_c_matrix.pyx":135
3032  * self.data_type_name = b'float32'
3033  *
3034  * elif A.dtype == b'float64': # <<<<<<<<<<<<<<
3035  * self.data_type_name = b'float64'
3036  *
3037  */
3038  goto __pyx_L5;
3039  }
3040 
3041  /* "imate/_c_linear_operator/py_c_matrix.pyx":138
3042  * self.data_type_name = b'float64'
3043  *
3044  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3045  * self.data_type_name = b'float128'
3046  *
3047  */
3048  __Pyx_TraceLine(138,0,__PYX_ERR(0, 138, __pyx_L1_error))
3049  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 138, __pyx_L1_error)
3050  __Pyx_GOTREF(__pyx_t_4);
3051  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 138, __pyx_L1_error)
3052  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3053  if (likely(__pyx_t_2)) {
3054 
3055  /* "imate/_c_linear_operator/py_c_matrix.pyx":139
3056  *
3057  * elif A.dtype == b'float128':
3058  * self.data_type_name = b'float128' # <<<<<<<<<<<<<<
3059  *
3060  * else:
3061  */
3062  __Pyx_TraceLine(139,0,__PYX_ERR(0, 139, __pyx_L1_error))
3063  __pyx_v_self->__pyx_base.data_type_name = ((char *)"float128");
3064 
3065  /* "imate/_c_linear_operator/py_c_matrix.pyx":138
3066  * self.data_type_name = b'float64'
3067  *
3068  * elif A.dtype == b'float128': # <<<<<<<<<<<<<<
3069  * self.data_type_name = b'float128'
3070  *
3071  */
3072  goto __pyx_L5;
3073  }
3074 
3075  /* "imate/_c_linear_operator/py_c_matrix.pyx":142
3076  *
3077  * else:
3078  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
3079  * '"float128".')
3080  *
3081  */
3082  __Pyx_TraceLine(142,0,__PYX_ERR(0, 142, __pyx_L1_error))
3083  /*else*/ {
3084  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3085  __Pyx_GOTREF(__pyx_t_4);
3086  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
3087  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3088  __PYX_ERR(0, 142, __pyx_L1_error)
3089  }
3090  __pyx_L5:;
3091 
3092  /* "imate/_c_linear_operator/py_c_matrix.pyx":146
3093  *
3094  * # Determine A is sparse or dense
3095  * if issparse(A): # <<<<<<<<<<<<<<
3096  *
3097  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3098  */
3099  __Pyx_TraceLine(146,0,__PYX_ERR(0, 146, __pyx_L1_error))
3100  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_issparse); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 146, __pyx_L1_error)
3101  __Pyx_GOTREF(__pyx_t_3);
3102  __pyx_t_5 = NULL;
3103  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3104  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3105  if (likely(__pyx_t_5)) {
3106  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3107  __Pyx_INCREF(__pyx_t_5);
3108  __Pyx_INCREF(function);
3109  __Pyx_DECREF_SET(__pyx_t_3, function);
3110  }
3111  }
3112  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3113  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3114  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
3115  __Pyx_GOTREF(__pyx_t_4);
3116  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3117  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3118  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3119  if (__pyx_t_2) {
3120 
3121  /* "imate/_c_linear_operator/py_c_matrix.pyx":149
3122  *
3123  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3124  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3125  *
3126  * # Check sorted indices
3127  */
3128  __Pyx_TraceLine(149,0,__PYX_ERR(0, 149, __pyx_L1_error))
3129  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 149, __pyx_L1_error)
3130  __Pyx_GOTREF(__pyx_t_3);
3131  __pyx_t_5 = NULL;
3132  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3133  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3134  if (likely(__pyx_t_5)) {
3135  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3136  __Pyx_INCREF(__pyx_t_5);
3137  __Pyx_INCREF(function);
3138  __Pyx_DECREF_SET(__pyx_t_3, function);
3139  }
3140  }
3141  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3142  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3143  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
3144  __Pyx_GOTREF(__pyx_t_4);
3145  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3146  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3147  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3148  if (__pyx_t_2) {
3149 
3150  /* "imate/_c_linear_operator/py_c_matrix.pyx":152
3151  *
3152  * # Check sorted indices
3153  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3154  * A.sort_indices()
3155  *
3156  */
3157  __Pyx_TraceLine(152,0,__PYX_ERR(0, 152, __pyx_L1_error))
3158  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
3159  __Pyx_GOTREF(__pyx_t_4);
3160  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3161  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3162  __pyx_t_1 = ((!__pyx_t_2) != 0);
3163  if (__pyx_t_1) {
3164 
3165  /* "imate/_c_linear_operator/py_c_matrix.pyx":153
3166  * # Check sorted indices
3167  * if not A.has_sorted_indices:
3168  * A.sort_indices() # <<<<<<<<<<<<<<
3169  *
3170  * # CSR matrix
3171  */
3172  __Pyx_TraceLine(153,0,__PYX_ERR(0, 153, __pyx_L1_error))
3173  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3174  __Pyx_GOTREF(__pyx_t_3);
3175  __pyx_t_5 = NULL;
3176  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3177  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3178  if (likely(__pyx_t_5)) {
3179  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3180  __Pyx_INCREF(__pyx_t_5);
3181  __Pyx_INCREF(function);
3182  __Pyx_DECREF_SET(__pyx_t_3, function);
3183  }
3184  }
3185  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3186  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3187  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3188  __Pyx_GOTREF(__pyx_t_4);
3189  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3190  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3191 
3192  /* "imate/_c_linear_operator/py_c_matrix.pyx":152
3193  *
3194  * # Check sorted indices
3195  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3196  * A.sort_indices()
3197  *
3198  */
3199  }
3200 
3201  /* "imate/_c_linear_operator/py_c_matrix.pyx":156
3202  *
3203  * # CSR matrix
3204  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3205  * self.set_csr_matrix_float(A)
3206  *
3207  */
3208  __Pyx_TraceLine(156,0,__PYX_ERR(0, 156, __pyx_L1_error))
3209  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 156, __pyx_L1_error)
3210  __Pyx_GOTREF(__pyx_t_4);
3211  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
3212  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3213  if (__pyx_t_1) {
3214 
3215  /* "imate/_c_linear_operator/py_c_matrix.pyx":157
3216  * # CSR matrix
3217  * if self.data_type_name == b'float32':
3218  * self.set_csr_matrix_float(A) # <<<<<<<<<<<<<<
3219  *
3220  * elif self.data_type_name == b'float64':
3221  */
3222  __Pyx_TraceLine(157,0,__PYX_ERR(0, 157, __pyx_L1_error))
3223  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
3224  __Pyx_GOTREF(__pyx_t_3);
3225  __pyx_t_5 = NULL;
3226  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3227  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3228  if (likely(__pyx_t_5)) {
3229  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3230  __Pyx_INCREF(__pyx_t_5);
3231  __Pyx_INCREF(function);
3232  __Pyx_DECREF_SET(__pyx_t_3, function);
3233  }
3234  }
3235  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3236  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3237  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 157, __pyx_L1_error)
3238  __Pyx_GOTREF(__pyx_t_4);
3239  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3240  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3241 
3242  /* "imate/_c_linear_operator/py_c_matrix.pyx":156
3243  *
3244  * # CSR matrix
3245  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3246  * self.set_csr_matrix_float(A)
3247  *
3248  */
3249  goto __pyx_L9;
3250  }
3251 
3252  /* "imate/_c_linear_operator/py_c_matrix.pyx":159
3253  * self.set_csr_matrix_float(A)
3254  *
3255  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3256  * self.set_csr_matrix_double(A)
3257  *
3258  */
3259  __Pyx_TraceLine(159,0,__PYX_ERR(0, 159, __pyx_L1_error))
3260  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3261  __Pyx_GOTREF(__pyx_t_4);
3262  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3263  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3264  if (__pyx_t_1) {
3265 
3266  /* "imate/_c_linear_operator/py_c_matrix.pyx":160
3267  *
3268  * elif self.data_type_name == b'float64':
3269  * self.set_csr_matrix_double(A) # <<<<<<<<<<<<<<
3270  *
3271  * elif self.data_type_name == b'float128':
3272  */
3273  __Pyx_TraceLine(160,0,__PYX_ERR(0, 160, __pyx_L1_error))
3274  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
3275  __Pyx_GOTREF(__pyx_t_3);
3276  __pyx_t_5 = NULL;
3277  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3278  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3279  if (likely(__pyx_t_5)) {
3280  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3281  __Pyx_INCREF(__pyx_t_5);
3282  __Pyx_INCREF(function);
3283  __Pyx_DECREF_SET(__pyx_t_3, function);
3284  }
3285  }
3286  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3287  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3288  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 160, __pyx_L1_error)
3289  __Pyx_GOTREF(__pyx_t_4);
3290  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3291  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3292 
3293  /* "imate/_c_linear_operator/py_c_matrix.pyx":159
3294  * self.set_csr_matrix_float(A)
3295  *
3296  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3297  * self.set_csr_matrix_double(A)
3298  *
3299  */
3300  goto __pyx_L9;
3301  }
3302 
3303  /* "imate/_c_linear_operator/py_c_matrix.pyx":162
3304  * self.set_csr_matrix_double(A)
3305  *
3306  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3307  * self.set_csr_matrix_long_double(A)
3308  *
3309  */
3310  __Pyx_TraceLine(162,0,__PYX_ERR(0, 162, __pyx_L1_error))
3311  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3312  __Pyx_GOTREF(__pyx_t_4);
3313  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
3314  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3315  if (__pyx_t_1) {
3316 
3317  /* "imate/_c_linear_operator/py_c_matrix.pyx":163
3318  *
3319  * elif self.data_type_name == b'float128':
3320  * self.set_csr_matrix_long_double(A) # <<<<<<<<<<<<<<
3321  *
3322  * elif isspmatrix_csc(A):
3323  */
3324  __Pyx_TraceLine(163,0,__PYX_ERR(0, 163, __pyx_L1_error))
3325  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 163, __pyx_L1_error)
3326  __Pyx_GOTREF(__pyx_t_3);
3327  __pyx_t_5 = NULL;
3328  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3329  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3330  if (likely(__pyx_t_5)) {
3331  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3332  __Pyx_INCREF(__pyx_t_5);
3333  __Pyx_INCREF(function);
3334  __Pyx_DECREF_SET(__pyx_t_3, function);
3335  }
3336  }
3337  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3338  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3339  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3340  __Pyx_GOTREF(__pyx_t_4);
3341  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3342  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3343 
3344  /* "imate/_c_linear_operator/py_c_matrix.pyx":162
3345  * self.set_csr_matrix_double(A)
3346  *
3347  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3348  * self.set_csr_matrix_long_double(A)
3349  *
3350  */
3351  }
3352  __pyx_L9:;
3353 
3354  /* "imate/_c_linear_operator/py_c_matrix.pyx":149
3355  *
3356  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3357  * if isspmatrix_csr(A): # <<<<<<<<<<<<<<
3358  *
3359  * # Check sorted indices
3360  */
3361  goto __pyx_L7;
3362  }
3363 
3364  /* "imate/_c_linear_operator/py_c_matrix.pyx":165
3365  * self.set_csr_matrix_long_double(A)
3366  *
3367  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3368  *
3369  * # Check sorted indices
3370  */
3371  __Pyx_TraceLine(165,0,__PYX_ERR(0, 165, __pyx_L1_error))
3372  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
3373  __Pyx_GOTREF(__pyx_t_3);
3374  __pyx_t_5 = NULL;
3375  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3376  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3377  if (likely(__pyx_t_5)) {
3378  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3379  __Pyx_INCREF(__pyx_t_5);
3380  __Pyx_INCREF(function);
3381  __Pyx_DECREF_SET(__pyx_t_3, function);
3382  }
3383  }
3384  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3385  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3386  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
3387  __Pyx_GOTREF(__pyx_t_4);
3388  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3389  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
3390  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3391  if (__pyx_t_1) {
3392 
3393  /* "imate/_c_linear_operator/py_c_matrix.pyx":168
3394  *
3395  * # Check sorted indices
3396  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3397  * A.sort_indices()
3398  *
3399  */
3400  __Pyx_TraceLine(168,0,__PYX_ERR(0, 168, __pyx_L1_error))
3401  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
3402  __Pyx_GOTREF(__pyx_t_4);
3403  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 168, __pyx_L1_error)
3404  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3405  __pyx_t_2 = ((!__pyx_t_1) != 0);
3406  if (__pyx_t_2) {
3407 
3408  /* "imate/_c_linear_operator/py_c_matrix.pyx":169
3409  * # Check sorted indices
3410  * if not A.has_sorted_indices:
3411  * A.sort_indices() # <<<<<<<<<<<<<<
3412  *
3413  * # CSC matrix
3414  */
3415  __Pyx_TraceLine(169,0,__PYX_ERR(0, 169, __pyx_L1_error))
3416  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
3417  __Pyx_GOTREF(__pyx_t_3);
3418  __pyx_t_5 = NULL;
3419  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3420  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3421  if (likely(__pyx_t_5)) {
3422  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3423  __Pyx_INCREF(__pyx_t_5);
3424  __Pyx_INCREF(function);
3425  __Pyx_DECREF_SET(__pyx_t_3, function);
3426  }
3427  }
3428  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3429  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3430  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
3431  __Pyx_GOTREF(__pyx_t_4);
3432  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3433  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3434 
3435  /* "imate/_c_linear_operator/py_c_matrix.pyx":168
3436  *
3437  * # Check sorted indices
3438  * if not A.has_sorted_indices: # <<<<<<<<<<<<<<
3439  * A.sort_indices()
3440  *
3441  */
3442  }
3443 
3444  /* "imate/_c_linear_operator/py_c_matrix.pyx":172
3445  *
3446  * # CSC matrix
3447  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3448  * self.set_csc_matrix_float(A)
3449  *
3450  */
3451  __Pyx_TraceLine(172,0,__PYX_ERR(0, 172, __pyx_L1_error))
3452  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
3453  __Pyx_GOTREF(__pyx_t_4);
3454  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 172, __pyx_L1_error)
3455  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3456  if (__pyx_t_2) {
3457 
3458  /* "imate/_c_linear_operator/py_c_matrix.pyx":173
3459  * # CSC matrix
3460  * if self.data_type_name == b'float32':
3461  * self.set_csc_matrix_float(A) # <<<<<<<<<<<<<<
3462  *
3463  * elif self.data_type_name == b'float64':
3464  */
3465  __Pyx_TraceLine(173,0,__PYX_ERR(0, 173, __pyx_L1_error))
3466  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
3467  __Pyx_GOTREF(__pyx_t_3);
3468  __pyx_t_5 = NULL;
3469  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3470  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3471  if (likely(__pyx_t_5)) {
3472  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3473  __Pyx_INCREF(__pyx_t_5);
3474  __Pyx_INCREF(function);
3475  __Pyx_DECREF_SET(__pyx_t_3, function);
3476  }
3477  }
3478  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3479  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3480  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
3481  __Pyx_GOTREF(__pyx_t_4);
3482  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3483  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3484 
3485  /* "imate/_c_linear_operator/py_c_matrix.pyx":172
3486  *
3487  * # CSC matrix
3488  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3489  * self.set_csc_matrix_float(A)
3490  *
3491  */
3492  goto __pyx_L11;
3493  }
3494 
3495  /* "imate/_c_linear_operator/py_c_matrix.pyx":175
3496  * self.set_csc_matrix_float(A)
3497  *
3498  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3499  * self.set_csc_matrix_double(A)
3500  *
3501  */
3502  __Pyx_TraceLine(175,0,__PYX_ERR(0, 175, __pyx_L1_error))
3503  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 175, __pyx_L1_error)
3504  __Pyx_GOTREF(__pyx_t_4);
3505  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 175, __pyx_L1_error)
3506  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3507  if (__pyx_t_2) {
3508 
3509  /* "imate/_c_linear_operator/py_c_matrix.pyx":176
3510  *
3511  * elif self.data_type_name == b'float64':
3512  * self.set_csc_matrix_double(A) # <<<<<<<<<<<<<<
3513  *
3514  * elif self.data_type_name == b'float128':
3515  */
3516  __Pyx_TraceLine(176,0,__PYX_ERR(0, 176, __pyx_L1_error))
3517  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
3518  __Pyx_GOTREF(__pyx_t_3);
3519  __pyx_t_5 = NULL;
3520  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3521  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3522  if (likely(__pyx_t_5)) {
3523  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3524  __Pyx_INCREF(__pyx_t_5);
3525  __Pyx_INCREF(function);
3526  __Pyx_DECREF_SET(__pyx_t_3, function);
3527  }
3528  }
3529  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3530  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3531  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 176, __pyx_L1_error)
3532  __Pyx_GOTREF(__pyx_t_4);
3533  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3534  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3535 
3536  /* "imate/_c_linear_operator/py_c_matrix.pyx":175
3537  * self.set_csc_matrix_float(A)
3538  *
3539  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3540  * self.set_csc_matrix_double(A)
3541  *
3542  */
3543  goto __pyx_L11;
3544  }
3545 
3546  /* "imate/_c_linear_operator/py_c_matrix.pyx":178
3547  * self.set_csc_matrix_double(A)
3548  *
3549  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3550  * self.set_csc_matrix_long_double(A)
3551  *
3552  */
3553  __Pyx_TraceLine(178,0,__PYX_ERR(0, 178, __pyx_L1_error))
3554  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
3555  __Pyx_GOTREF(__pyx_t_4);
3556  __pyx_t_2 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
3557  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3558  if (__pyx_t_2) {
3559 
3560  /* "imate/_c_linear_operator/py_c_matrix.pyx":179
3561  *
3562  * elif self.data_type_name == b'float128':
3563  * self.set_csc_matrix_long_double(A) # <<<<<<<<<<<<<<
3564  *
3565  * else:
3566  */
3567  __Pyx_TraceLine(179,0,__PYX_ERR(0, 179, __pyx_L1_error))
3568  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csc_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
3569  __Pyx_GOTREF(__pyx_t_3);
3570  __pyx_t_5 = NULL;
3571  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3572  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3573  if (likely(__pyx_t_5)) {
3574  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3575  __Pyx_INCREF(__pyx_t_5);
3576  __Pyx_INCREF(function);
3577  __Pyx_DECREF_SET(__pyx_t_3, function);
3578  }
3579  }
3580  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3581  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3582  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 179, __pyx_L1_error)
3583  __Pyx_GOTREF(__pyx_t_4);
3584  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3585  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3586 
3587  /* "imate/_c_linear_operator/py_c_matrix.pyx":178
3588  * self.set_csc_matrix_double(A)
3589  *
3590  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3591  * self.set_csc_matrix_long_double(A)
3592  *
3593  */
3594  }
3595  __pyx_L11:;
3596 
3597  /* "imate/_c_linear_operator/py_c_matrix.pyx":165
3598  * self.set_csr_matrix_long_double(A)
3599  *
3600  * elif isspmatrix_csc(A): # <<<<<<<<<<<<<<
3601  *
3602  * # Check sorted indices
3603  */
3604  goto __pyx_L7;
3605  }
3606 
3607  /* "imate/_c_linear_operator/py_c_matrix.pyx":184
3608  *
3609  * # If A is neither CSR or CSC, convert A to CSR
3610  * self.A_csr = csr_matrix(A) # <<<<<<<<<<<<<<
3611  *
3612  * # Check sorted indices
3613  */
3614  __Pyx_TraceLine(184,0,__PYX_ERR(0, 184, __pyx_L1_error))
3615  /*else*/ {
3616  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
3617  __Pyx_GOTREF(__pyx_t_3);
3618  __pyx_t_5 = NULL;
3619  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
3620  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3621  if (likely(__pyx_t_5)) {
3622  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3623  __Pyx_INCREF(__pyx_t_5);
3624  __Pyx_INCREF(function);
3625  __Pyx_DECREF_SET(__pyx_t_3, function);
3626  }
3627  }
3628  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3629  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3630  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
3631  __Pyx_GOTREF(__pyx_t_4);
3632  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3633  __Pyx_GIVEREF(__pyx_t_4);
3634  __Pyx_GOTREF(__pyx_v_self->A_csr);
3635  __Pyx_DECREF(__pyx_v_self->A_csr);
3636  __pyx_v_self->A_csr = __pyx_t_4;
3637  __pyx_t_4 = 0;
3638 
3639  /* "imate/_c_linear_operator/py_c_matrix.pyx":187
3640  *
3641  * # Check sorted indices
3642  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
3643  * self.A_csr.sort_indices()
3644  *
3645  */
3646  __Pyx_TraceLine(187,0,__PYX_ERR(0, 187, __pyx_L1_error))
3647  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_has_sorted_indices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
3648  __Pyx_GOTREF(__pyx_t_4);
3649  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 187, __pyx_L1_error)
3650  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3651  __pyx_t_1 = ((!__pyx_t_2) != 0);
3652  if (__pyx_t_1) {
3653 
3654  /* "imate/_c_linear_operator/py_c_matrix.pyx":188
3655  * # Check sorted indices
3656  * if not self.A_csr.has_sorted_indices:
3657  * self.A_csr.sort_indices() # <<<<<<<<<<<<<<
3658  *
3659  * # CSR matrix
3660  */
3661  __Pyx_TraceLine(188,0,__PYX_ERR(0, 188, __pyx_L1_error))
3662  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->A_csr, __pyx_n_s_sort_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 188, __pyx_L1_error)
3663  __Pyx_GOTREF(__pyx_t_3);
3664  __pyx_t_5 = NULL;
3665  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3666  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3667  if (likely(__pyx_t_5)) {
3668  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3669  __Pyx_INCREF(__pyx_t_5);
3670  __Pyx_INCREF(function);
3671  __Pyx_DECREF_SET(__pyx_t_3, function);
3672  }
3673  }
3674  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_5) : __Pyx_PyObject_CallNoArg(__pyx_t_3);
3675  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3676  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
3677  __Pyx_GOTREF(__pyx_t_4);
3678  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3679  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3680 
3681  /* "imate/_c_linear_operator/py_c_matrix.pyx":187
3682  *
3683  * # Check sorted indices
3684  * if not self.A_csr.has_sorted_indices: # <<<<<<<<<<<<<<
3685  * self.A_csr.sort_indices()
3686  *
3687  */
3688  }
3689 
3690  /* "imate/_c_linear_operator/py_c_matrix.pyx":191
3691  *
3692  * # CSR matrix
3693  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3694  * self.set_csr_matrix_float(self.A_csr)
3695  *
3696  */
3697  __Pyx_TraceLine(191,0,__PYX_ERR(0, 191, __pyx_L1_error))
3698  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
3699  __Pyx_GOTREF(__pyx_t_4);
3700  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 191, __pyx_L1_error)
3701  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3702  if (__pyx_t_1) {
3703 
3704  /* "imate/_c_linear_operator/py_c_matrix.pyx":192
3705  * # CSR matrix
3706  * if self.data_type_name == b'float32':
3707  * self.set_csr_matrix_float(self.A_csr) # <<<<<<<<<<<<<<
3708  *
3709  * elif self.data_type_name == b'float64':
3710  */
3711  __Pyx_TraceLine(192,0,__PYX_ERR(0, 192, __pyx_L1_error))
3712  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 192, __pyx_L1_error)
3713  __Pyx_GOTREF(__pyx_t_3);
3714  __pyx_t_5 = NULL;
3715  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3716  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3717  if (likely(__pyx_t_5)) {
3718  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3719  __Pyx_INCREF(__pyx_t_5);
3720  __Pyx_INCREF(function);
3721  __Pyx_DECREF_SET(__pyx_t_3, function);
3722  }
3723  }
3724  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3725  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3726  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 192, __pyx_L1_error)
3727  __Pyx_GOTREF(__pyx_t_4);
3728  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3729  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3730 
3731  /* "imate/_c_linear_operator/py_c_matrix.pyx":191
3732  *
3733  * # CSR matrix
3734  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3735  * self.set_csr_matrix_float(self.A_csr)
3736  *
3737  */
3738  goto __pyx_L13;
3739  }
3740 
3741  /* "imate/_c_linear_operator/py_c_matrix.pyx":194
3742  * self.set_csr_matrix_float(self.A_csr)
3743  *
3744  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3745  * self.set_csr_matrix_double(self.A_csr)
3746  *
3747  */
3748  __Pyx_TraceLine(194,0,__PYX_ERR(0, 194, __pyx_L1_error))
3749  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 194, __pyx_L1_error)
3750  __Pyx_GOTREF(__pyx_t_4);
3751  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 194, __pyx_L1_error)
3752  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3753  if (__pyx_t_1) {
3754 
3755  /* "imate/_c_linear_operator/py_c_matrix.pyx":195
3756  *
3757  * elif self.data_type_name == b'float64':
3758  * self.set_csr_matrix_double(self.A_csr) # <<<<<<<<<<<<<<
3759  *
3760  * elif self.data_type_name == b'float128':
3761  */
3762  __Pyx_TraceLine(195,0,__PYX_ERR(0, 195, __pyx_L1_error))
3763  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
3764  __Pyx_GOTREF(__pyx_t_3);
3765  __pyx_t_5 = NULL;
3766  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3767  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3768  if (likely(__pyx_t_5)) {
3769  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3770  __Pyx_INCREF(__pyx_t_5);
3771  __Pyx_INCREF(function);
3772  __Pyx_DECREF_SET(__pyx_t_3, function);
3773  }
3774  }
3775  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3776  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3777  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 195, __pyx_L1_error)
3778  __Pyx_GOTREF(__pyx_t_4);
3779  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3780  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3781 
3782  /* "imate/_c_linear_operator/py_c_matrix.pyx":194
3783  * self.set_csr_matrix_float(self.A_csr)
3784  *
3785  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3786  * self.set_csr_matrix_double(self.A_csr)
3787  *
3788  */
3789  goto __pyx_L13;
3790  }
3791 
3792  /* "imate/_c_linear_operator/py_c_matrix.pyx":197
3793  * self.set_csr_matrix_double(self.A_csr)
3794  *
3795  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3796  * self.set_csr_matrix_long_double(self.A_csr)
3797  *
3798  */
3799  __Pyx_TraceLine(197,0,__PYX_ERR(0, 197, __pyx_L1_error))
3800  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
3801  __Pyx_GOTREF(__pyx_t_4);
3802  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
3803  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3804  if (__pyx_t_1) {
3805 
3806  /* "imate/_c_linear_operator/py_c_matrix.pyx":198
3807  *
3808  * elif self.data_type_name == b'float128':
3809  * self.set_csr_matrix_long_double(self.A_csr) # <<<<<<<<<<<<<<
3810  *
3811  * else:
3812  */
3813  __Pyx_TraceLine(198,0,__PYX_ERR(0, 198, __pyx_L1_error))
3814  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_csr_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 198, __pyx_L1_error)
3815  __Pyx_GOTREF(__pyx_t_3);
3816  __pyx_t_5 = NULL;
3817  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3818  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3819  if (likely(__pyx_t_5)) {
3820  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3821  __Pyx_INCREF(__pyx_t_5);
3822  __Pyx_INCREF(function);
3823  __Pyx_DECREF_SET(__pyx_t_3, function);
3824  }
3825  }
3826  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_self->A_csr) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_self->A_csr);
3827  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3828  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 198, __pyx_L1_error)
3829  __Pyx_GOTREF(__pyx_t_4);
3830  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3831  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3832 
3833  /* "imate/_c_linear_operator/py_c_matrix.pyx":197
3834  * self.set_csr_matrix_double(self.A_csr)
3835  *
3836  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3837  * self.set_csr_matrix_long_double(self.A_csr)
3838  *
3839  */
3840  }
3841  __pyx_L13:;
3842  }
3843  __pyx_L7:;
3844 
3845  /* "imate/_c_linear_operator/py_c_matrix.pyx":146
3846  *
3847  * # Determine A is sparse or dense
3848  * if issparse(A): # <<<<<<<<<<<<<<
3849  *
3850  * # Matrix type codes: 'r' for CSR, and 'c' for CSC
3851  */
3852  goto __pyx_L6;
3853  }
3854 
3855  /* "imate/_c_linear_operator/py_c_matrix.pyx":203
3856  *
3857  * # Set a dense matrix
3858  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3859  * self.set_dense_matrix_float(A)
3860  *
3861  */
3862  __Pyx_TraceLine(203,0,__PYX_ERR(0, 203, __pyx_L1_error))
3863  /*else*/ {
3864  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 203, __pyx_L1_error)
3865  __Pyx_GOTREF(__pyx_t_4);
3866  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float32, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 203, __pyx_L1_error)
3867  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3868  if (__pyx_t_1) {
3869 
3870  /* "imate/_c_linear_operator/py_c_matrix.pyx":204
3871  * # Set a dense matrix
3872  * if self.data_type_name == b'float32':
3873  * self.set_dense_matrix_float(A) # <<<<<<<<<<<<<<
3874  *
3875  * elif self.data_type_name == b'float64':
3876  */
3877  __Pyx_TraceLine(204,0,__PYX_ERR(0, 204, __pyx_L1_error))
3878  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_float); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
3879  __Pyx_GOTREF(__pyx_t_3);
3880  __pyx_t_5 = NULL;
3881  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3882  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3883  if (likely(__pyx_t_5)) {
3884  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3885  __Pyx_INCREF(__pyx_t_5);
3886  __Pyx_INCREF(function);
3887  __Pyx_DECREF_SET(__pyx_t_3, function);
3888  }
3889  }
3890  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3891  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3892  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
3893  __Pyx_GOTREF(__pyx_t_4);
3894  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3895  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3896 
3897  /* "imate/_c_linear_operator/py_c_matrix.pyx":203
3898  *
3899  * # Set a dense matrix
3900  * if self.data_type_name == b'float32': # <<<<<<<<<<<<<<
3901  * self.set_dense_matrix_float(A)
3902  *
3903  */
3904  goto __pyx_L14;
3905  }
3906 
3907  /* "imate/_c_linear_operator/py_c_matrix.pyx":206
3908  * self.set_dense_matrix_float(A)
3909  *
3910  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3911  * self.set_dense_matrix_double(A)
3912  *
3913  */
3914  __Pyx_TraceLine(206,0,__PYX_ERR(0, 206, __pyx_L1_error))
3915  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 206, __pyx_L1_error)
3916  __Pyx_GOTREF(__pyx_t_4);
3917  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float64, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 206, __pyx_L1_error)
3918  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3919  if (__pyx_t_1) {
3920 
3921  /* "imate/_c_linear_operator/py_c_matrix.pyx":207
3922  *
3923  * elif self.data_type_name == b'float64':
3924  * self.set_dense_matrix_double(A) # <<<<<<<<<<<<<<
3925  *
3926  * elif self.data_type_name == b'float128':
3927  */
3928  __Pyx_TraceLine(207,0,__PYX_ERR(0, 207, __pyx_L1_error))
3929  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
3930  __Pyx_GOTREF(__pyx_t_3);
3931  __pyx_t_5 = NULL;
3932  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3933  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3934  if (likely(__pyx_t_5)) {
3935  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3936  __Pyx_INCREF(__pyx_t_5);
3937  __Pyx_INCREF(function);
3938  __Pyx_DECREF_SET(__pyx_t_3, function);
3939  }
3940  }
3941  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3942  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3943  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
3944  __Pyx_GOTREF(__pyx_t_4);
3945  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3946  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3947 
3948  /* "imate/_c_linear_operator/py_c_matrix.pyx":206
3949  * self.set_dense_matrix_float(A)
3950  *
3951  * elif self.data_type_name == b'float64': # <<<<<<<<<<<<<<
3952  * self.set_dense_matrix_double(A)
3953  *
3954  */
3955  goto __pyx_L14;
3956  }
3957 
3958  /* "imate/_c_linear_operator/py_c_matrix.pyx":209
3959  * self.set_dense_matrix_double(A)
3960  *
3961  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
3962  * self.set_dense_matrix_long_double(A)
3963  *
3964  */
3965  __Pyx_TraceLine(209,0,__PYX_ERR(0, 209, __pyx_L1_error))
3966  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.data_type_name); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
3967  __Pyx_GOTREF(__pyx_t_4);
3968  __pyx_t_1 = (__Pyx_PyBytes_Equals(__pyx_t_4, __pyx_n_b_float128, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
3969  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3970  if (__pyx_t_1) {
3971 
3972  /* "imate/_c_linear_operator/py_c_matrix.pyx":210
3973  *
3974  * elif self.data_type_name == b'float128':
3975  * self.set_dense_matrix_long_double(A) # <<<<<<<<<<<<<<
3976  *
3977  * # ======================
3978  */
3979  __Pyx_TraceLine(210,0,__PYX_ERR(0, 210, __pyx_L1_error))
3980  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_set_dense_matrix_long_double); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
3981  __Pyx_GOTREF(__pyx_t_3);
3982  __pyx_t_5 = NULL;
3983  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
3984  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_3);
3985  if (likely(__pyx_t_5)) {
3986  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
3987  __Pyx_INCREF(__pyx_t_5);
3988  __Pyx_INCREF(function);
3989  __Pyx_DECREF_SET(__pyx_t_3, function);
3990  }
3991  }
3992  __pyx_t_4 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_5, __pyx_v_A) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_A);
3993  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3994  if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
3995  __Pyx_GOTREF(__pyx_t_4);
3996  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3997  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3998 
3999  /* "imate/_c_linear_operator/py_c_matrix.pyx":209
4000  * self.set_dense_matrix_double(A)
4001  *
4002  * elif self.data_type_name == b'float128': # <<<<<<<<<<<<<<
4003  * self.set_dense_matrix_long_double(A)
4004  *
4005  */
4006  }
4007  __pyx_L14:;
4008  }
4009  __pyx_L6:;
4010 
4011  /* "imate/_c_linear_operator/py_c_matrix.pyx":119
4012  * # =========
4013  *
4014  * def __cinit__(self, A): # <<<<<<<<<<<<<<
4015  * """
4016  * Sets the matrix A.
4017  */
4018 
4019  /* function exit code */
4020  __pyx_r = 0;
4021  goto __pyx_L0;
4022  __pyx_L1_error:;
4023  __Pyx_XDECREF(__pyx_t_3);
4024  __Pyx_XDECREF(__pyx_t_4);
4025  __Pyx_XDECREF(__pyx_t_5);
4026  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4027  __pyx_r = -1;
4028  __pyx_L0:;
4029  __Pyx_TraceReturn(Py_None, 0);
4030  __Pyx_RefNannyFinishContext();
4031  return __pyx_r;
4032 }
4033 
4034 /* "imate/_c_linear_operator/py_c_matrix.pyx":216
4035  * # ======================
4036  *
4037  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
4038  * """
4039  * Sets matrix A.
4040  */
4041 
4042 /* Python wrapper */
4043 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4044 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float[] = "pycMatrix.set_dense_matrix_float(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4045 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float = {"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float};
4046 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4047  PyObject *__pyx_r = 0;
4048  __Pyx_RefNannyDeclarations
4049  __Pyx_RefNannySetupContext("set_dense_matrix_float (wrapper)", 0);
4050  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4051 
4052  /* function exit code */
4053  __Pyx_RefNannyFinishContext();
4054  return __pyx_r;
4055 }
4056 
4057 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4058  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4059  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4060  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4061  __Pyx_memviewslice __pyx_v_A_data_float_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4062  __Pyx_memviewslice __pyx_v_A_data_float_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4063  float *__pyx_v_A_data_float;
4064  PyObject *__pyx_r = NULL;
4065  __Pyx_TraceDeclarations
4066  __Pyx_RefNannyDeclarations
4067  PyObject *__pyx_t_1 = NULL;
4068  PyObject *__pyx_t_2 = NULL;
4069  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4070  int __pyx_t_4;
4071  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4072  Py_ssize_t __pyx_t_6;
4073  Py_ssize_t __pyx_t_7;
4074  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4075  cDenseMatrix<float> *__pyx_t_9;
4076  int __pyx_lineno = 0;
4077  const char *__pyx_filename = NULL;
4078  int __pyx_clineno = 0;
4079  __Pyx_TraceFrameInit(__pyx_codeobj__4)
4080  __Pyx_RefNannySetupContext("set_dense_matrix_float", 0);
4081  __Pyx_TraceCall("set_dense_matrix_float", __pyx_f[0], 216, 0, __PYX_ERR(0, 216, __pyx_L1_error));
4082 
4083  /* "imate/_c_linear_operator/py_c_matrix.pyx":225
4084  *
4085  * # Matrix size
4086  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4087  * cdef LongIndexType A_num_columns = A.shape[1]
4088  *
4089  */
4090  __Pyx_TraceLine(225,0,__PYX_ERR(0, 225, __pyx_L1_error))
4091  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 225, __pyx_L1_error)
4092  __Pyx_GOTREF(__pyx_t_1);
4093  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 225, __pyx_L1_error)
4094  __Pyx_GOTREF(__pyx_t_2);
4095  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4096  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 225, __pyx_L1_error)
4097  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4098  __pyx_v_A_num_rows = __pyx_t_3;
4099 
4100  /* "imate/_c_linear_operator/py_c_matrix.pyx":226
4101  * # Matrix size
4102  * cdef LongIndexType A_num_rows = A.shape[0]
4103  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4104  *
4105  * # Contiguity
4106  */
4107  __Pyx_TraceLine(226,0,__PYX_ERR(0, 226, __pyx_L1_error))
4108  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 226, __pyx_L1_error)
4109  __Pyx_GOTREF(__pyx_t_2);
4110  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 226, __pyx_L1_error)
4111  __Pyx_GOTREF(__pyx_t_1);
4112  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4113  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 226, __pyx_L1_error)
4114  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4115  __pyx_v_A_num_columns = __pyx_t_3;
4116 
4117  /* "imate/_c_linear_operator/py_c_matrix.pyx":230
4118  * # Contiguity
4119  * cdef FlagType A_is_row_major
4120  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4121  * A_is_row_major = 1
4122  * elif A.flags['F_CONTIGUOUS']:
4123  */
4124  __Pyx_TraceLine(230,0,__PYX_ERR(0, 230, __pyx_L1_error))
4125  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 230, __pyx_L1_error)
4126  __Pyx_GOTREF(__pyx_t_1);
4127  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 230, __pyx_L1_error)
4128  __Pyx_GOTREF(__pyx_t_2);
4129  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4130  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 230, __pyx_L1_error)
4131  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4132  if (__pyx_t_4) {
4133 
4134  /* "imate/_c_linear_operator/py_c_matrix.pyx":231
4135  * cdef FlagType A_is_row_major
4136  * if A.flags['C_CONTIGUOUS']:
4137  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4138  * elif A.flags['F_CONTIGUOUS']:
4139  * A_is_row_major = 0
4140  */
4141  __Pyx_TraceLine(231,0,__PYX_ERR(0, 231, __pyx_L1_error))
4142  __pyx_v_A_is_row_major = 1;
4143 
4144  /* "imate/_c_linear_operator/py_c_matrix.pyx":230
4145  * # Contiguity
4146  * cdef FlagType A_is_row_major
4147  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4148  * A_is_row_major = 1
4149  * elif A.flags['F_CONTIGUOUS']:
4150  */
4151  goto __pyx_L3;
4152  }
4153 
4154  /* "imate/_c_linear_operator/py_c_matrix.pyx":232
4155  * if A.flags['C_CONTIGUOUS']:
4156  * A_is_row_major = 1
4157  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4158  * A_is_row_major = 0
4159  * else:
4160  */
4161  __Pyx_TraceLine(232,0,__PYX_ERR(0, 232, __pyx_L1_error))
4162  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 232, __pyx_L1_error)
4163  __Pyx_GOTREF(__pyx_t_2);
4164  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 232, __pyx_L1_error)
4165  __Pyx_GOTREF(__pyx_t_1);
4166  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4167  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 232, __pyx_L1_error)
4168  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4169  if (likely(__pyx_t_4)) {
4170 
4171  /* "imate/_c_linear_operator/py_c_matrix.pyx":233
4172  * A_is_row_major = 1
4173  * elif A.flags['F_CONTIGUOUS']:
4174  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4175  * else:
4176  * raise TypeError('Matrix A should be either C or F contiguous.')
4177  */
4178  __Pyx_TraceLine(233,0,__PYX_ERR(0, 233, __pyx_L1_error))
4179  __pyx_v_A_is_row_major = 0;
4180 
4181  /* "imate/_c_linear_operator/py_c_matrix.pyx":232
4182  * if A.flags['C_CONTIGUOUS']:
4183  * A_is_row_major = 1
4184  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4185  * A_is_row_major = 0
4186  * else:
4187  */
4188  goto __pyx_L3;
4189  }
4190 
4191  /* "imate/_c_linear_operator/py_c_matrix.pyx":235
4192  * A_is_row_major = 0
4193  * else:
4194  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4195  *
4196  * # Declare memoryviews to get data pointer
4197  */
4198  __Pyx_TraceLine(235,0,__PYX_ERR(0, 235, __pyx_L1_error))
4199  /*else*/ {
4200  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 235, __pyx_L1_error)
4201  __Pyx_GOTREF(__pyx_t_1);
4202  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4203  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4204  __PYX_ERR(0, 235, __pyx_L1_error)
4205  }
4206  __pyx_L3:;
4207 
4208  /* "imate/_c_linear_operator/py_c_matrix.pyx":245
4209  *
4210  * # Get pointer to data of A depending on row or column major
4211  * if A_is_row_major: # <<<<<<<<<<<<<<
4212  *
4213  * # Memoryview of A for row major matrix
4214  */
4215  __Pyx_TraceLine(245,0,__PYX_ERR(0, 245, __pyx_L1_error))
4216  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4217  if (__pyx_t_4) {
4218 
4219  /* "imate/_c_linear_operator/py_c_matrix.pyx":248
4220  *
4221  * # Memoryview of A for row major matrix
4222  * A_data_float_mv_c = A # <<<<<<<<<<<<<<
4223  *
4224  * # Pointer of the data of A
4225  */
4226  __Pyx_TraceLine(248,0,__PYX_ERR(0, 248, __pyx_L1_error))
4227  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 248, __pyx_L1_error)
4228  __pyx_v_A_data_float_mv_c = __pyx_t_5;
4229  __pyx_t_5.memview = NULL;
4230  __pyx_t_5.data = NULL;
4231 
4232  /* "imate/_c_linear_operator/py_c_matrix.pyx":251
4233  *
4234  * # Pointer of the data of A
4235  * A_data_float = &A_data_float_mv_c[0, 0] # <<<<<<<<<<<<<<
4236  *
4237  * else:
4238  */
4239  __Pyx_TraceLine(251,0,__PYX_ERR(0, 251, __pyx_L1_error))
4240  __pyx_t_6 = 0;
4241  __pyx_t_7 = 0;
4242  __pyx_v_A_data_float = (&(*((float *) ( /* dim=1 */ ((char *) (((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv_c.data + __pyx_t_6 * __pyx_v_A_data_float_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4243 
4244  /* "imate/_c_linear_operator/py_c_matrix.pyx":245
4245  *
4246  * # Get pointer to data of A depending on row or column major
4247  * if A_is_row_major: # <<<<<<<<<<<<<<
4248  *
4249  * # Memoryview of A for row major matrix
4250  */
4251  goto __pyx_L4;
4252  }
4253 
4254  /* "imate/_c_linear_operator/py_c_matrix.pyx":256
4255  *
4256  * # Memoryview of A for column major matrix
4257  * A_data_float_mv_f = A # <<<<<<<<<<<<<<
4258  *
4259  * # Pointer of the data of A
4260  */
4261  __Pyx_TraceLine(256,0,__PYX_ERR(0, 256, __pyx_L1_error))
4262  /*else*/ {
4263  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__float(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 256, __pyx_L1_error)
4264  __pyx_v_A_data_float_mv_f = __pyx_t_8;
4265  __pyx_t_8.memview = NULL;
4266  __pyx_t_8.data = NULL;
4267 
4268  /* "imate/_c_linear_operator/py_c_matrix.pyx":259
4269  *
4270  * # Pointer of the data of A
4271  * A_data_float = &A_data_float_mv_f[0, 0] # <<<<<<<<<<<<<<
4272  *
4273  * # Create a linear operator object
4274  */
4275  __Pyx_TraceLine(259,0,__PYX_ERR(0, 259, __pyx_L1_error))
4276  __pyx_t_7 = 0;
4277  __pyx_t_6 = 0;
4278  __pyx_v_A_data_float = (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((float *) __pyx_v_A_data_float_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_float_mv_f.strides[1]) ))));
4279  }
4280  __pyx_L4:;
4281 
4282  /* "imate/_c_linear_operator/py_c_matrix.pyx":262
4283  *
4284  * # Create a linear operator object
4285  * self.Aop_float = new cDenseMatrix[float]( # <<<<<<<<<<<<<<
4286  * A_data_float,
4287  * A_num_rows,
4288  */
4289  __Pyx_TraceLine(262,0,__PYX_ERR(0, 262, __pyx_L1_error))
4290  try {
4291  __pyx_t_9 = new cDenseMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4292  } catch(...) {
4293  __Pyx_CppExn2PyErr();
4294  __PYX_ERR(0, 262, __pyx_L1_error)
4295  }
4296  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
4297 
4298  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
4299  * # ======================
4300  *
4301  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
4302  * """
4303  * Sets matrix A.
4304  */
4305 
4306  /* function exit code */
4307  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4308  goto __pyx_L0;
4309  __pyx_L1_error:;
4310  __Pyx_XDECREF(__pyx_t_1);
4311  __Pyx_XDECREF(__pyx_t_2);
4312  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4313  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4314  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
4315  __pyx_r = NULL;
4316  __pyx_L0:;
4317  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_c, 1);
4318  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv_f, 1);
4319  __Pyx_XGIVEREF(__pyx_r);
4320  __Pyx_TraceReturn(__pyx_r, 0);
4321  __Pyx_RefNannyFinishContext();
4322  return __pyx_r;
4323 }
4324 
4325 /* "imate/_c_linear_operator/py_c_matrix.pyx":272
4326  * # =======================
4327  *
4328  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
4329  * """
4330  * Sets matrix A.
4331  */
4332 
4333 /* Python wrapper */
4334 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4335 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double[] = "pycMatrix.set_dense_matrix_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4336 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double = {"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double};
4337 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4338  PyObject *__pyx_r = 0;
4339  __Pyx_RefNannyDeclarations
4340  __Pyx_RefNannySetupContext("set_dense_matrix_double (wrapper)", 0);
4341  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4342 
4343  /* function exit code */
4344  __Pyx_RefNannyFinishContext();
4345  return __pyx_r;
4346 }
4347 
4348 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4349  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4350  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4351  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4352  __Pyx_memviewslice __pyx_v_A_data_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4353  __Pyx_memviewslice __pyx_v_A_data_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4354  double *__pyx_v_A_data_double;
4355  PyObject *__pyx_r = NULL;
4356  __Pyx_TraceDeclarations
4357  __Pyx_RefNannyDeclarations
4358  PyObject *__pyx_t_1 = NULL;
4359  PyObject *__pyx_t_2 = NULL;
4360  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4361  int __pyx_t_4;
4362  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4363  Py_ssize_t __pyx_t_6;
4364  Py_ssize_t __pyx_t_7;
4365  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4366  cDenseMatrix<double> *__pyx_t_9;
4367  int __pyx_lineno = 0;
4368  const char *__pyx_filename = NULL;
4369  int __pyx_clineno = 0;
4370  __Pyx_TraceFrameInit(__pyx_codeobj__6)
4371  __Pyx_RefNannySetupContext("set_dense_matrix_double", 0);
4372  __Pyx_TraceCall("set_dense_matrix_double", __pyx_f[0], 272, 0, __PYX_ERR(0, 272, __pyx_L1_error));
4373 
4374  /* "imate/_c_linear_operator/py_c_matrix.pyx":281
4375  *
4376  * # Matrix size
4377  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4378  * cdef LongIndexType A_num_columns = A.shape[1]
4379  *
4380  */
4381  __Pyx_TraceLine(281,0,__PYX_ERR(0, 281, __pyx_L1_error))
4382  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 281, __pyx_L1_error)
4383  __Pyx_GOTREF(__pyx_t_1);
4384  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 281, __pyx_L1_error)
4385  __Pyx_GOTREF(__pyx_t_2);
4386  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4387  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
4388  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4389  __pyx_v_A_num_rows = __pyx_t_3;
4390 
4391  /* "imate/_c_linear_operator/py_c_matrix.pyx":282
4392  * # Matrix size
4393  * cdef LongIndexType A_num_rows = A.shape[0]
4394  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4395  *
4396  * # Contiguity
4397  */
4398  __Pyx_TraceLine(282,0,__PYX_ERR(0, 282, __pyx_L1_error))
4399  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 282, __pyx_L1_error)
4400  __Pyx_GOTREF(__pyx_t_2);
4401  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 282, __pyx_L1_error)
4402  __Pyx_GOTREF(__pyx_t_1);
4403  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4404  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 282, __pyx_L1_error)
4405  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4406  __pyx_v_A_num_columns = __pyx_t_3;
4407 
4408  /* "imate/_c_linear_operator/py_c_matrix.pyx":286
4409  * # Contiguity
4410  * cdef FlagType A_is_row_major
4411  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4412  * A_is_row_major = 1
4413  * elif A.flags['F_CONTIGUOUS']:
4414  */
4415  __Pyx_TraceLine(286,0,__PYX_ERR(0, 286, __pyx_L1_error))
4416  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
4417  __Pyx_GOTREF(__pyx_t_1);
4418  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 286, __pyx_L1_error)
4419  __Pyx_GOTREF(__pyx_t_2);
4420  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4421  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 286, __pyx_L1_error)
4422  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4423  if (__pyx_t_4) {
4424 
4425  /* "imate/_c_linear_operator/py_c_matrix.pyx":287
4426  * cdef FlagType A_is_row_major
4427  * if A.flags['C_CONTIGUOUS']:
4428  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4429  * elif A.flags['F_CONTIGUOUS']:
4430  * A_is_row_major = 0
4431  */
4432  __Pyx_TraceLine(287,0,__PYX_ERR(0, 287, __pyx_L1_error))
4433  __pyx_v_A_is_row_major = 1;
4434 
4435  /* "imate/_c_linear_operator/py_c_matrix.pyx":286
4436  * # Contiguity
4437  * cdef FlagType A_is_row_major
4438  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4439  * A_is_row_major = 1
4440  * elif A.flags['F_CONTIGUOUS']:
4441  */
4442  goto __pyx_L3;
4443  }
4444 
4445  /* "imate/_c_linear_operator/py_c_matrix.pyx":288
4446  * if A.flags['C_CONTIGUOUS']:
4447  * A_is_row_major = 1
4448  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4449  * A_is_row_major = 0
4450  * else:
4451  */
4452  __Pyx_TraceLine(288,0,__PYX_ERR(0, 288, __pyx_L1_error))
4453  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
4454  __Pyx_GOTREF(__pyx_t_2);
4455  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 288, __pyx_L1_error)
4456  __Pyx_GOTREF(__pyx_t_1);
4457  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4458  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
4459  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4460  if (likely(__pyx_t_4)) {
4461 
4462  /* "imate/_c_linear_operator/py_c_matrix.pyx":289
4463  * A_is_row_major = 1
4464  * elif A.flags['F_CONTIGUOUS']:
4465  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4466  * else:
4467  * raise TypeError('Matrix A should be either C or F contiguous.')
4468  */
4469  __Pyx_TraceLine(289,0,__PYX_ERR(0, 289, __pyx_L1_error))
4470  __pyx_v_A_is_row_major = 0;
4471 
4472  /* "imate/_c_linear_operator/py_c_matrix.pyx":288
4473  * if A.flags['C_CONTIGUOUS']:
4474  * A_is_row_major = 1
4475  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4476  * A_is_row_major = 0
4477  * else:
4478  */
4479  goto __pyx_L3;
4480  }
4481 
4482  /* "imate/_c_linear_operator/py_c_matrix.pyx":291
4483  * A_is_row_major = 0
4484  * else:
4485  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4486  *
4487  * # Declare memoryviews to get data pointer
4488  */
4489  __Pyx_TraceLine(291,0,__PYX_ERR(0, 291, __pyx_L1_error))
4490  /*else*/ {
4491  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
4492  __Pyx_GOTREF(__pyx_t_1);
4493  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4494  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4495  __PYX_ERR(0, 291, __pyx_L1_error)
4496  }
4497  __pyx_L3:;
4498 
4499  /* "imate/_c_linear_operator/py_c_matrix.pyx":301
4500  *
4501  * # Get pointer to data of A depending on row or column major
4502  * if A_is_row_major: # <<<<<<<<<<<<<<
4503  *
4504  * # Memoryview of A for row major matrix
4505  */
4506  __Pyx_TraceLine(301,0,__PYX_ERR(0, 301, __pyx_L1_error))
4507  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4508  if (__pyx_t_4) {
4509 
4510  /* "imate/_c_linear_operator/py_c_matrix.pyx":304
4511  *
4512  * # Memoryview of A for row major matrix
4513  * A_data_double_mv_c = A # <<<<<<<<<<<<<<
4514  *
4515  * # Pointer of the data of A
4516  */
4517  __Pyx_TraceLine(304,0,__PYX_ERR(0, 304, __pyx_L1_error))
4518  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 304, __pyx_L1_error)
4519  __pyx_v_A_data_double_mv_c = __pyx_t_5;
4520  __pyx_t_5.memview = NULL;
4521  __pyx_t_5.data = NULL;
4522 
4523  /* "imate/_c_linear_operator/py_c_matrix.pyx":307
4524  *
4525  * # Pointer of the data of A
4526  * A_data_double = &A_data_double_mv_c[0, 0] # <<<<<<<<<<<<<<
4527  *
4528  * else:
4529  */
4530  __Pyx_TraceLine(307,0,__PYX_ERR(0, 307, __pyx_L1_error))
4531  __pyx_t_6 = 0;
4532  __pyx_t_7 = 0;
4533  __pyx_v_A_data_double = (&(*((double *) ( /* dim=1 */ ((char *) (((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4534 
4535  /* "imate/_c_linear_operator/py_c_matrix.pyx":301
4536  *
4537  * # Get pointer to data of A depending on row or column major
4538  * if A_is_row_major: # <<<<<<<<<<<<<<
4539  *
4540  * # Memoryview of A for row major matrix
4541  */
4542  goto __pyx_L4;
4543  }
4544 
4545  /* "imate/_c_linear_operator/py_c_matrix.pyx":312
4546  *
4547  * # Memoryview of A for column major matrix
4548  * A_data_double_mv_f = A # <<<<<<<<<<<<<<
4549  *
4550  * # Pointer of the data of A
4551  */
4552  __Pyx_TraceLine(312,0,__PYX_ERR(0, 312, __pyx_L1_error))
4553  /*else*/ {
4554  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 312, __pyx_L1_error)
4555  __pyx_v_A_data_double_mv_f = __pyx_t_8;
4556  __pyx_t_8.memview = NULL;
4557  __pyx_t_8.data = NULL;
4558 
4559  /* "imate/_c_linear_operator/py_c_matrix.pyx":315
4560  *
4561  * # Pointer of the data of A
4562  * A_data_double = &A_data_double_mv_f[0, 0] # <<<<<<<<<<<<<<
4563  *
4564  * # Create a linear operator object
4565  */
4566  __Pyx_TraceLine(315,0,__PYX_ERR(0, 315, __pyx_L1_error))
4567  __pyx_t_7 = 0;
4568  __pyx_t_6 = 0;
4569  __pyx_v_A_data_double = (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((double *) __pyx_v_A_data_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_double_mv_f.strides[1]) ))));
4570  }
4571  __pyx_L4:;
4572 
4573  /* "imate/_c_linear_operator/py_c_matrix.pyx":318
4574  *
4575  * # Create a linear operator object
4576  * self.Aop_double = new cDenseMatrix[double]( # <<<<<<<<<<<<<<
4577  * A_data_double,
4578  * A_num_rows,
4579  */
4580  __Pyx_TraceLine(318,0,__PYX_ERR(0, 318, __pyx_L1_error))
4581  try {
4582  __pyx_t_9 = new cDenseMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4583  } catch(...) {
4584  __Pyx_CppExn2PyErr();
4585  __PYX_ERR(0, 318, __pyx_L1_error)
4586  }
4587  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
4588 
4589  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
4590  * # =======================
4591  *
4592  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
4593  * """
4594  * Sets matrix A.
4595  */
4596 
4597  /* function exit code */
4598  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4599  goto __pyx_L0;
4600  __pyx_L1_error:;
4601  __Pyx_XDECREF(__pyx_t_1);
4602  __Pyx_XDECREF(__pyx_t_2);
4603  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4604  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4605  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4606  __pyx_r = NULL;
4607  __pyx_L0:;
4608  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_c, 1);
4609  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv_f, 1);
4610  __Pyx_XGIVEREF(__pyx_r);
4611  __Pyx_TraceReturn(__pyx_r, 0);
4612  __Pyx_RefNannyFinishContext();
4613  return __pyx_r;
4614 }
4615 
4616 /* "imate/_c_linear_operator/py_c_matrix.pyx":328
4617  * # ============================
4618  *
4619  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
4620  * """
4621  * Sets matrix A.
4622  */
4623 
4624 /* Python wrapper */
4625 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4626 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double[] = "pycMatrix.set_dense_matrix_long_double(self, A)\n\n Sets matrix A.\n\n :param A: A 2-dimensional matrix.\n :type A: numpy.ndarray, or any scipy.sparse array\n ";
4627 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double = {"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double};
4628 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4629  PyObject *__pyx_r = 0;
4630  __Pyx_RefNannyDeclarations
4631  __Pyx_RefNannySetupContext("set_dense_matrix_long_double (wrapper)", 0);
4632  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4633 
4634  /* function exit code */
4635  __Pyx_RefNannyFinishContext();
4636  return __pyx_r;
4637 }
4638 
4639 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4640  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4641  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4642  __pyx_t_5imate_12_definitions_5types_FlagType __pyx_v_A_is_row_major;
4643  __Pyx_memviewslice __pyx_v_A_data_long_double_mv_c = { 0, 0, { 0 }, { 0 }, { 0 } };
4644  __Pyx_memviewslice __pyx_v_A_data_long_double_mv_f = { 0, 0, { 0 }, { 0 }, { 0 } };
4645  long double *__pyx_v_A_data_long_double;
4646  PyObject *__pyx_r = NULL;
4647  __Pyx_TraceDeclarations
4648  __Pyx_RefNannyDeclarations
4649  PyObject *__pyx_t_1 = NULL;
4650  PyObject *__pyx_t_2 = NULL;
4651  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4652  int __pyx_t_4;
4653  __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
4654  Py_ssize_t __pyx_t_6;
4655  Py_ssize_t __pyx_t_7;
4656  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4657  cDenseMatrix<long double> *__pyx_t_9;
4658  int __pyx_lineno = 0;
4659  const char *__pyx_filename = NULL;
4660  int __pyx_clineno = 0;
4661  __Pyx_TraceFrameInit(__pyx_codeobj__7)
4662  __Pyx_RefNannySetupContext("set_dense_matrix_long_double", 0);
4663  __Pyx_TraceCall("set_dense_matrix_long_double", __pyx_f[0], 328, 0, __PYX_ERR(0, 328, __pyx_L1_error));
4664 
4665  /* "imate/_c_linear_operator/py_c_matrix.pyx":337
4666  *
4667  * # Matrix size
4668  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4669  * cdef LongIndexType A_num_columns = A.shape[1]
4670  *
4671  */
4672  __Pyx_TraceLine(337,0,__PYX_ERR(0, 337, __pyx_L1_error))
4673  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 337, __pyx_L1_error)
4674  __Pyx_GOTREF(__pyx_t_1);
4675  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 337, __pyx_L1_error)
4676  __Pyx_GOTREF(__pyx_t_2);
4677  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4678  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 337, __pyx_L1_error)
4679  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4680  __pyx_v_A_num_rows = __pyx_t_3;
4681 
4682  /* "imate/_c_linear_operator/py_c_matrix.pyx":338
4683  * # Matrix size
4684  * cdef LongIndexType A_num_rows = A.shape[0]
4685  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4686  *
4687  * # Contiguity
4688  */
4689  __Pyx_TraceLine(338,0,__PYX_ERR(0, 338, __pyx_L1_error))
4690  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 338, __pyx_L1_error)
4691  __Pyx_GOTREF(__pyx_t_2);
4692  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 338, __pyx_L1_error)
4693  __Pyx_GOTREF(__pyx_t_1);
4694  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4695  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 338, __pyx_L1_error)
4696  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4697  __pyx_v_A_num_columns = __pyx_t_3;
4698 
4699  /* "imate/_c_linear_operator/py_c_matrix.pyx":342
4700  * # Contiguity
4701  * cdef FlagType A_is_row_major
4702  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4703  * A_is_row_major = 1
4704  * elif A.flags['F_CONTIGUOUS']:
4705  */
4706  __Pyx_TraceLine(342,0,__PYX_ERR(0, 342, __pyx_L1_error))
4707  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 342, __pyx_L1_error)
4708  __Pyx_GOTREF(__pyx_t_1);
4709  __pyx_t_2 = __Pyx_PyObject_Dict_GetItem(__pyx_t_1, __pyx_n_u_C_CONTIGUOUS); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 342, __pyx_L1_error)
4710  __Pyx_GOTREF(__pyx_t_2);
4711  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4712  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 342, __pyx_L1_error)
4713  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4714  if (__pyx_t_4) {
4715 
4716  /* "imate/_c_linear_operator/py_c_matrix.pyx":343
4717  * cdef FlagType A_is_row_major
4718  * if A.flags['C_CONTIGUOUS']:
4719  * A_is_row_major = 1 # <<<<<<<<<<<<<<
4720  * elif A.flags['F_CONTIGUOUS']:
4721  * A_is_row_major = 0
4722  */
4723  __Pyx_TraceLine(343,0,__PYX_ERR(0, 343, __pyx_L1_error))
4724  __pyx_v_A_is_row_major = 1;
4725 
4726  /* "imate/_c_linear_operator/py_c_matrix.pyx":342
4727  * # Contiguity
4728  * cdef FlagType A_is_row_major
4729  * if A.flags['C_CONTIGUOUS']: # <<<<<<<<<<<<<<
4730  * A_is_row_major = 1
4731  * elif A.flags['F_CONTIGUOUS']:
4732  */
4733  goto __pyx_L3;
4734  }
4735 
4736  /* "imate/_c_linear_operator/py_c_matrix.pyx":344
4737  * if A.flags['C_CONTIGUOUS']:
4738  * A_is_row_major = 1
4739  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4740  * A_is_row_major = 0
4741  * else:
4742  */
4743  __Pyx_TraceLine(344,0,__PYX_ERR(0, 344, __pyx_L1_error))
4744  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_flags); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
4745  __Pyx_GOTREF(__pyx_t_2);
4746  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_t_2, __pyx_n_u_F_CONTIGUOUS); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 344, __pyx_L1_error)
4747  __Pyx_GOTREF(__pyx_t_1);
4748  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4749  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 344, __pyx_L1_error)
4750  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4751  if (likely(__pyx_t_4)) {
4752 
4753  /* "imate/_c_linear_operator/py_c_matrix.pyx":345
4754  * A_is_row_major = 1
4755  * elif A.flags['F_CONTIGUOUS']:
4756  * A_is_row_major = 0 # <<<<<<<<<<<<<<
4757  * else:
4758  * raise TypeError('Matrix A should be either C or F contiguous.')
4759  */
4760  __Pyx_TraceLine(345,0,__PYX_ERR(0, 345, __pyx_L1_error))
4761  __pyx_v_A_is_row_major = 0;
4762 
4763  /* "imate/_c_linear_operator/py_c_matrix.pyx":344
4764  * if A.flags['C_CONTIGUOUS']:
4765  * A_is_row_major = 1
4766  * elif A.flags['F_CONTIGUOUS']: # <<<<<<<<<<<<<<
4767  * A_is_row_major = 0
4768  * else:
4769  */
4770  goto __pyx_L3;
4771  }
4772 
4773  /* "imate/_c_linear_operator/py_c_matrix.pyx":347
4774  * A_is_row_major = 0
4775  * else:
4776  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
4777  *
4778  * # Declare memoryviews to get data pointer
4779  */
4780  __Pyx_TraceLine(347,0,__PYX_ERR(0, 347, __pyx_L1_error))
4781  /*else*/ {
4782  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 347, __pyx_L1_error)
4783  __Pyx_GOTREF(__pyx_t_1);
4784  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4786  __PYX_ERR(0, 347, __pyx_L1_error)
4787  }
4788  __pyx_L3:;
4789 
4790  /* "imate/_c_linear_operator/py_c_matrix.pyx":357
4791  *
4792  * # Get pointer to data of A depending on row or column major
4793  * if A_is_row_major: # <<<<<<<<<<<<<<
4794  *
4795  * # Memoryview of A for row major matrix
4796  */
4797  __Pyx_TraceLine(357,0,__PYX_ERR(0, 357, __pyx_L1_error))
4798  __pyx_t_4 = (__pyx_v_A_is_row_major != 0);
4799  if (__pyx_t_4) {
4800 
4801  /* "imate/_c_linear_operator/py_c_matrix.pyx":360
4802  *
4803  * # Memoryview of A for row major matrix
4804  * A_data_long_double_mv_c = A # <<<<<<<<<<<<<<
4805  *
4806  * # Pointer of the data of A
4807  */
4808  __Pyx_TraceLine(360,0,__PYX_ERR(0, 360, __pyx_L1_error))
4809  __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 360, __pyx_L1_error)
4810  __pyx_v_A_data_long_double_mv_c = __pyx_t_5;
4811  __pyx_t_5.memview = NULL;
4812  __pyx_t_5.data = NULL;
4813 
4814  /* "imate/_c_linear_operator/py_c_matrix.pyx":363
4815  *
4816  * # Pointer of the data of A
4817  * A_data_long_double = &A_data_long_double_mv_c[0, 0] # <<<<<<<<<<<<<<
4818  *
4819  * else:
4820  */
4821  __Pyx_TraceLine(363,0,__PYX_ERR(0, 363, __pyx_L1_error))
4822  __pyx_t_6 = 0;
4823  __pyx_t_7 = 0;
4824  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=1 */ ((char *) (((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv_c.data + __pyx_t_6 * __pyx_v_A_data_long_double_mv_c.strides[0]) )) + __pyx_t_7)) ))));
4825 
4826  /* "imate/_c_linear_operator/py_c_matrix.pyx":357
4827  *
4828  * # Get pointer to data of A depending on row or column major
4829  * if A_is_row_major: # <<<<<<<<<<<<<<
4830  *
4831  * # Memoryview of A for row major matrix
4832  */
4833  goto __pyx_L4;
4834  }
4835 
4836  /* "imate/_c_linear_operator/py_c_matrix.pyx":368
4837  *
4838  * # Memoryview of A for column major matrix
4839  * A_data_long_double_mv_f = A # <<<<<<<<<<<<<<
4840  *
4841  * # Pointer of the data of A
4842  */
4843  __Pyx_TraceLine(368,0,__PYX_ERR(0, 368, __pyx_L1_error))
4844  /*else*/ {
4845  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(__pyx_v_A, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 368, __pyx_L1_error)
4846  __pyx_v_A_data_long_double_mv_f = __pyx_t_8;
4847  __pyx_t_8.memview = NULL;
4848  __pyx_t_8.data = NULL;
4849 
4850  /* "imate/_c_linear_operator/py_c_matrix.pyx":371
4851  *
4852  * # Pointer of the data of A
4853  * A_data_long_double = &A_data_long_double_mv_f[0, 0] # <<<<<<<<<<<<<<
4854  *
4855  * # Create a linear operator object
4856  */
4857  __Pyx_TraceLine(371,0,__PYX_ERR(0, 371, __pyx_L1_error))
4858  __pyx_t_7 = 0;
4859  __pyx_t_6 = 0;
4860  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=1 */ (( /* dim=0 */ ((char *) (((long double *) __pyx_v_A_data_long_double_mv_f.data) + __pyx_t_7)) ) + __pyx_t_6 * __pyx_v_A_data_long_double_mv_f.strides[1]) ))));
4861  }
4862  __pyx_L4:;
4863 
4864  /* "imate/_c_linear_operator/py_c_matrix.pyx":374
4865  *
4866  * # Create a linear operator object
4867  * self.Aop_long_double = new cDenseMatrix[long double]( # <<<<<<<<<<<<<<
4868  * A_data_long_double,
4869  * A_num_rows,
4870  */
4871  __Pyx_TraceLine(374,0,__PYX_ERR(0, 374, __pyx_L1_error))
4872  try {
4873  __pyx_t_9 = new cDenseMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_num_rows, __pyx_v_A_num_columns, __pyx_v_A_is_row_major);
4874  } catch(...) {
4875  __Pyx_CppExn2PyErr();
4876  __PYX_ERR(0, 374, __pyx_L1_error)
4877  }
4878  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
4879 
4880  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
4881  * # ============================
4882  *
4883  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
4884  * """
4885  * Sets matrix A.
4886  */
4887 
4888  /* function exit code */
4889  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4890  goto __pyx_L0;
4891  __pyx_L1_error:;
4892  __Pyx_XDECREF(__pyx_t_1);
4893  __Pyx_XDECREF(__pyx_t_2);
4894  __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
4895  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
4896  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_dense_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
4897  __pyx_r = NULL;
4898  __pyx_L0:;
4899  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_c, 1);
4900  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv_f, 1);
4901  __Pyx_XGIVEREF(__pyx_r);
4902  __Pyx_TraceReturn(__pyx_r, 0);
4903  __Pyx_RefNannyFinishContext();
4904  return __pyx_r;
4905 }
4906 
4907 /* "imate/_c_linear_operator/py_c_matrix.pyx":384
4908  * # ====================
4909  *
4910  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
4911  * """
4912  * """
4913  */
4914 
4915 /* Python wrapper */
4916 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
4917 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float[] = "pycMatrix.set_csr_matrix_float(self, A)\n\n ";
4918 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float = {"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float};
4919 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
4920  PyObject *__pyx_r = 0;
4921  __Pyx_RefNannyDeclarations
4922  __Pyx_RefNannySetupContext("set_csr_matrix_float (wrapper)", 0);
4923  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
4924 
4925  /* function exit code */
4926  __Pyx_RefNannyFinishContext();
4927  return __pyx_r;
4928 }
4929 
4930 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
4931  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
4932  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
4933  __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
4934  float *__pyx_v_A_data_float;
4935  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
4936  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
4937  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
4938  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
4939  PyObject *__pyx_r = NULL;
4940  __Pyx_TraceDeclarations
4941  __Pyx_RefNannyDeclarations
4942  PyObject *__pyx_t_1 = NULL;
4943  PyObject *__pyx_t_2 = NULL;
4944  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
4945  PyObject *__pyx_t_4 = NULL;
4946  PyObject *__pyx_t_5 = NULL;
4947  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
4948  Py_ssize_t __pyx_t_7;
4949  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
4950  cCSRMatrix<float> *__pyx_t_9;
4951  int __pyx_lineno = 0;
4952  const char *__pyx_filename = NULL;
4953  int __pyx_clineno = 0;
4954  __Pyx_TraceFrameInit(__pyx_codeobj__8)
4955  __Pyx_RefNannySetupContext("set_csr_matrix_float", 0);
4956  __Pyx_TraceCall("set_csr_matrix_float", __pyx_f[0], 384, 0, __PYX_ERR(0, 384, __pyx_L1_error));
4957 
4958  /* "imate/_c_linear_operator/py_c_matrix.pyx":389
4959  *
4960  * # Matrix size
4961  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
4962  * cdef LongIndexType A_num_columns = A.shape[1]
4963  *
4964  */
4965  __Pyx_TraceLine(389,0,__PYX_ERR(0, 389, __pyx_L1_error))
4966  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 389, __pyx_L1_error)
4967  __Pyx_GOTREF(__pyx_t_1);
4968  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 389, __pyx_L1_error)
4969  __Pyx_GOTREF(__pyx_t_2);
4970  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4971  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 389, __pyx_L1_error)
4972  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4973  __pyx_v_A_num_rows = __pyx_t_3;
4974 
4975  /* "imate/_c_linear_operator/py_c_matrix.pyx":390
4976  * # Matrix size
4977  * cdef LongIndexType A_num_rows = A.shape[0]
4978  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
4979  *
4980  * # Declare memoryviews to get pointer of A.data
4981  */
4982  __Pyx_TraceLine(390,0,__PYX_ERR(0, 390, __pyx_L1_error))
4983  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 390, __pyx_L1_error)
4984  __Pyx_GOTREF(__pyx_t_2);
4985  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 390, __pyx_L1_error)
4986  __Pyx_GOTREF(__pyx_t_1);
4987  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4988  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
4989  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4990  __pyx_v_A_num_columns = __pyx_t_3;
4991 
4992  /* "imate/_c_linear_operator/py_c_matrix.pyx":400
4993  * # If the input type is the same as LongIndexType, no copy is performed.
4994  * self.A_indices_copy = \
4995  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
4996  * self.A_index_pointer_copy = \
4997  * A.indptr.astype(self.long_index_type_name, copy=False)
4998  */
4999  __Pyx_TraceLine(400,0,__PYX_ERR(0, 400, __pyx_L1_error))
5000  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5001  __Pyx_GOTREF(__pyx_t_1);
5002  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 400, __pyx_L1_error)
5003  __Pyx_GOTREF(__pyx_t_2);
5004  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5005  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5006  __Pyx_GOTREF(__pyx_t_1);
5007  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
5008  __Pyx_GOTREF(__pyx_t_4);
5009  __Pyx_GIVEREF(__pyx_t_1);
5010  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5011  __pyx_t_1 = 0;
5012  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 400, __pyx_L1_error)
5013  __Pyx_GOTREF(__pyx_t_1);
5014  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 400, __pyx_L1_error)
5015  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 400, __pyx_L1_error)
5016  __Pyx_GOTREF(__pyx_t_5);
5017  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5018  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5019  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5020 
5021  /* "imate/_c_linear_operator/py_c_matrix.pyx":399
5022  *
5023  * # If the input type is the same as LongIndexType, no copy is performed.
5024  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5025  * A.indices.astype(self.long_index_type_name, copy=False)
5026  * self.A_index_pointer_copy = \
5027  */
5028  __Pyx_TraceLine(399,0,__PYX_ERR(0, 399, __pyx_L1_error))
5029  __Pyx_GIVEREF(__pyx_t_5);
5030  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5031  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5032  __pyx_v_self->A_indices_copy = __pyx_t_5;
5033  __pyx_t_5 = 0;
5034 
5035  /* "imate/_c_linear_operator/py_c_matrix.pyx":402
5036  * A.indices.astype(self.long_index_type_name, copy=False)
5037  * self.A_index_pointer_copy = \
5038  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5039  *
5040  * # Declare memoryviews to get pointer of A.indices and A.indptr
5041  */
5042  __Pyx_TraceLine(402,0,__PYX_ERR(0, 402, __pyx_L1_error))
5043  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5044  __Pyx_GOTREF(__pyx_t_5);
5045  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 402, __pyx_L1_error)
5046  __Pyx_GOTREF(__pyx_t_1);
5047  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5048  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5049  __Pyx_GOTREF(__pyx_t_5);
5050  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
5051  __Pyx_GOTREF(__pyx_t_4);
5052  __Pyx_GIVEREF(__pyx_t_5);
5053  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5054  __pyx_t_5 = 0;
5055  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
5056  __Pyx_GOTREF(__pyx_t_5);
5057  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 402, __pyx_L1_error)
5058  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 402, __pyx_L1_error)
5059  __Pyx_GOTREF(__pyx_t_2);
5060  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5061  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5062  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5063 
5064  /* "imate/_c_linear_operator/py_c_matrix.pyx":401
5065  * self.A_indices_copy = \
5066  * A.indices.astype(self.long_index_type_name, copy=False)
5067  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5068  * A.indptr.astype(self.long_index_type_name, copy=False)
5069  *
5070  */
5071  __Pyx_TraceLine(401,0,__PYX_ERR(0, 401, __pyx_L1_error))
5072  __Pyx_GIVEREF(__pyx_t_2);
5073  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5074  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5075  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5076  __pyx_t_2 = 0;
5077 
5078  /* "imate/_c_linear_operator/py_c_matrix.pyx":405
5079  *
5080  * # Declare memoryviews to get pointer of A.indices and A.indptr
5081  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5082  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5083  * self.A_index_pointer_copy
5084  */
5085  __Pyx_TraceLine(405,0,__PYX_ERR(0, 405, __pyx_L1_error))
5086  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 405, __pyx_L1_error)
5087  __pyx_v_A_indices_mv = __pyx_t_6;
5088  __pyx_t_6.memview = NULL;
5089  __pyx_t_6.data = NULL;
5090 
5091  /* "imate/_c_linear_operator/py_c_matrix.pyx":407
5092  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5093  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5094  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5095  *
5096  * # Declare pointers to A.indices ans A.indptr
5097  */
5098  __Pyx_TraceLine(407,0,__PYX_ERR(0, 407, __pyx_L1_error))
5099  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 407, __pyx_L1_error)
5100  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5101  __pyx_t_6.memview = NULL;
5102  __pyx_t_6.data = NULL;
5103 
5104  /* "imate/_c_linear_operator/py_c_matrix.pyx":410
5105  *
5106  * # Declare pointers to A.indices ans A.indptr
5107  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5108  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5109  *
5110  */
5111  __Pyx_TraceLine(410,0,__PYX_ERR(0, 410, __pyx_L1_error))
5112  __pyx_t_7 = 0;
5113  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5114 
5115  /* "imate/_c_linear_operator/py_c_matrix.pyx":411
5116  * # Declare pointers to A.indices ans A.indptr
5117  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5118  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5119  *
5120  * # Memoryview of A data
5121  */
5122  __Pyx_TraceLine(411,0,__PYX_ERR(0, 411, __pyx_L1_error))
5123  __pyx_t_7 = 0;
5124  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5125 
5126  /* "imate/_c_linear_operator/py_c_matrix.pyx":414
5127  *
5128  * # Memoryview of A data
5129  * A_data_float_mv = A.data # <<<<<<<<<<<<<<
5130  *
5131  * # Get pointers
5132  */
5133  __Pyx_TraceLine(414,0,__PYX_ERR(0, 414, __pyx_L1_error))
5134  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 414, __pyx_L1_error)
5135  __Pyx_GOTREF(__pyx_t_2);
5136  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 414, __pyx_L1_error)
5137  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5138  __pyx_v_A_data_float_mv = __pyx_t_8;
5139  __pyx_t_8.memview = NULL;
5140  __pyx_t_8.data = NULL;
5141 
5142  /* "imate/_c_linear_operator/py_c_matrix.pyx":417
5143  *
5144  * # Get pointers
5145  * A_data_float = &A_data_float_mv[0] # <<<<<<<<<<<<<<
5146  *
5147  * # Create a linear operator object
5148  */
5149  __Pyx_TraceLine(417,0,__PYX_ERR(0, 417, __pyx_L1_error))
5150  __pyx_t_7 = 0;
5151  __pyx_v_A_data_float = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
5152 
5153  /* "imate/_c_linear_operator/py_c_matrix.pyx":420
5154  *
5155  * # Create a linear operator object
5156  * self.Aop_float = new cCSRMatrix[float]( # <<<<<<<<<<<<<<
5157  * A_data_float,
5158  * A_indices,
5159  */
5160  __Pyx_TraceLine(420,0,__PYX_ERR(0, 420, __pyx_L1_error))
5161  try {
5162  __pyx_t_9 = new cCSRMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5163  } catch(...) {
5164  __Pyx_CppExn2PyErr();
5165  __PYX_ERR(0, 420, __pyx_L1_error)
5166  }
5167  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
5168 
5169  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
5170  * # ====================
5171  *
5172  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
5173  * """
5174  * """
5175  */
5176 
5177  /* function exit code */
5178  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5179  goto __pyx_L0;
5180  __pyx_L1_error:;
5181  __Pyx_XDECREF(__pyx_t_1);
5182  __Pyx_XDECREF(__pyx_t_2);
5183  __Pyx_XDECREF(__pyx_t_4);
5184  __Pyx_XDECREF(__pyx_t_5);
5185  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5186  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5187  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
5188  __pyx_r = NULL;
5189  __pyx_L0:;
5190  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
5191  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5192  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5193  __Pyx_XGIVEREF(__pyx_r);
5194  __Pyx_TraceReturn(__pyx_r, 0);
5195  __Pyx_RefNannyFinishContext();
5196  return __pyx_r;
5197 }
5198 
5199 /* "imate/_c_linear_operator/py_c_matrix.pyx":431
5200  * # =====================
5201  *
5202  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
5203  * """
5204  * """
5205  */
5206 
5207 /* Python wrapper */
5208 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5209 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double[] = "pycMatrix.set_csr_matrix_double(self, A)\n\n ";
5210 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double = {"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double};
5211 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5212  PyObject *__pyx_r = 0;
5213  __Pyx_RefNannyDeclarations
5214  __Pyx_RefNannySetupContext("set_csr_matrix_double (wrapper)", 0);
5215  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5216 
5217  /* function exit code */
5218  __Pyx_RefNannyFinishContext();
5219  return __pyx_r;
5220 }
5221 
5222 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5223  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5224  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5225  __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5226  double *__pyx_v_A_data_double;
5227  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5228  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5229  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5230  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5231  PyObject *__pyx_r = NULL;
5232  __Pyx_TraceDeclarations
5233  __Pyx_RefNannyDeclarations
5234  PyObject *__pyx_t_1 = NULL;
5235  PyObject *__pyx_t_2 = NULL;
5236  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5237  PyObject *__pyx_t_4 = NULL;
5238  PyObject *__pyx_t_5 = NULL;
5239  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5240  Py_ssize_t __pyx_t_7;
5241  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5242  cCSRMatrix<double> *__pyx_t_9;
5243  int __pyx_lineno = 0;
5244  const char *__pyx_filename = NULL;
5245  int __pyx_clineno = 0;
5246  __Pyx_TraceFrameInit(__pyx_codeobj__9)
5247  __Pyx_RefNannySetupContext("set_csr_matrix_double", 0);
5248  __Pyx_TraceCall("set_csr_matrix_double", __pyx_f[0], 431, 0, __PYX_ERR(0, 431, __pyx_L1_error));
5249 
5250  /* "imate/_c_linear_operator/py_c_matrix.pyx":436
5251  *
5252  * # Matrix size
5253  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5254  * cdef LongIndexType A_num_columns = A.shape[1]
5255  *
5256  */
5257  __Pyx_TraceLine(436,0,__PYX_ERR(0, 436, __pyx_L1_error))
5258  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
5259  __Pyx_GOTREF(__pyx_t_1);
5260  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 436, __pyx_L1_error)
5261  __Pyx_GOTREF(__pyx_t_2);
5262  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5263  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 436, __pyx_L1_error)
5264  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5265  __pyx_v_A_num_rows = __pyx_t_3;
5266 
5267  /* "imate/_c_linear_operator/py_c_matrix.pyx":437
5268  * # Matrix size
5269  * cdef LongIndexType A_num_rows = A.shape[0]
5270  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5271  *
5272  * # Declare memoryviews to get pointer of A.data
5273  */
5274  __Pyx_TraceLine(437,0,__PYX_ERR(0, 437, __pyx_L1_error))
5275  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 437, __pyx_L1_error)
5276  __Pyx_GOTREF(__pyx_t_2);
5277  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 437, __pyx_L1_error)
5278  __Pyx_GOTREF(__pyx_t_1);
5279  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5280  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 437, __pyx_L1_error)
5281  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5282  __pyx_v_A_num_columns = __pyx_t_3;
5283 
5284  /* "imate/_c_linear_operator/py_c_matrix.pyx":447
5285  * # If the input type is the same as LongIndexType, no copy is performed.
5286  * self.A_indices_copy = \
5287  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5288  * self.A_index_pointer_copy = \
5289  * A.indptr.astype(self.long_index_type_name, copy=False)
5290  */
5291  __Pyx_TraceLine(447,0,__PYX_ERR(0, 447, __pyx_L1_error))
5292  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5293  __Pyx_GOTREF(__pyx_t_1);
5294  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 447, __pyx_L1_error)
5295  __Pyx_GOTREF(__pyx_t_2);
5296  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5297  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5298  __Pyx_GOTREF(__pyx_t_1);
5299  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 447, __pyx_L1_error)
5300  __Pyx_GOTREF(__pyx_t_4);
5301  __Pyx_GIVEREF(__pyx_t_1);
5302  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5303  __pyx_t_1 = 0;
5304  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 447, __pyx_L1_error)
5305  __Pyx_GOTREF(__pyx_t_1);
5306  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 447, __pyx_L1_error)
5307  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 447, __pyx_L1_error)
5308  __Pyx_GOTREF(__pyx_t_5);
5309  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5310  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5311  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5312 
5313  /* "imate/_c_linear_operator/py_c_matrix.pyx":446
5314  *
5315  * # If the input type is the same as LongIndexType, no copy is performed.
5316  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5317  * A.indices.astype(self.long_index_type_name, copy=False)
5318  * self.A_index_pointer_copy = \
5319  */
5320  __Pyx_TraceLine(446,0,__PYX_ERR(0, 446, __pyx_L1_error))
5321  __Pyx_GIVEREF(__pyx_t_5);
5322  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5323  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5324  __pyx_v_self->A_indices_copy = __pyx_t_5;
5325  __pyx_t_5 = 0;
5326 
5327  /* "imate/_c_linear_operator/py_c_matrix.pyx":449
5328  * A.indices.astype(self.long_index_type_name, copy=False)
5329  * self.A_index_pointer_copy = \
5330  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5331  *
5332  * # Declare memoryviews to get pointer of A.indices and A.indptr
5333  */
5334  __Pyx_TraceLine(449,0,__PYX_ERR(0, 449, __pyx_L1_error))
5335  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5336  __Pyx_GOTREF(__pyx_t_5);
5337  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 449, __pyx_L1_error)
5338  __Pyx_GOTREF(__pyx_t_1);
5339  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5340  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5341  __Pyx_GOTREF(__pyx_t_5);
5342  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 449, __pyx_L1_error)
5343  __Pyx_GOTREF(__pyx_t_4);
5344  __Pyx_GIVEREF(__pyx_t_5);
5345  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5346  __pyx_t_5 = 0;
5347  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 449, __pyx_L1_error)
5348  __Pyx_GOTREF(__pyx_t_5);
5349  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 449, __pyx_L1_error)
5350  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 449, __pyx_L1_error)
5351  __Pyx_GOTREF(__pyx_t_2);
5352  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5353  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5354  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5355 
5356  /* "imate/_c_linear_operator/py_c_matrix.pyx":448
5357  * self.A_indices_copy = \
5358  * A.indices.astype(self.long_index_type_name, copy=False)
5359  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5360  * A.indptr.astype(self.long_index_type_name, copy=False)
5361  *
5362  */
5363  __Pyx_TraceLine(448,0,__PYX_ERR(0, 448, __pyx_L1_error))
5364  __Pyx_GIVEREF(__pyx_t_2);
5365  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5366  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5367  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5368  __pyx_t_2 = 0;
5369 
5370  /* "imate/_c_linear_operator/py_c_matrix.pyx":452
5371  *
5372  * # Declare memoryviews to get pointer of A.indices and A.indptr
5373  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5374  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5375  * self.A_index_pointer_copy
5376  */
5377  __Pyx_TraceLine(452,0,__PYX_ERR(0, 452, __pyx_L1_error))
5378  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 452, __pyx_L1_error)
5379  __pyx_v_A_indices_mv = __pyx_t_6;
5380  __pyx_t_6.memview = NULL;
5381  __pyx_t_6.data = NULL;
5382 
5383  /* "imate/_c_linear_operator/py_c_matrix.pyx":454
5384  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5385  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5386  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5387  *
5388  * # Declare pointers to A.indices ans A.indptr
5389  */
5390  __Pyx_TraceLine(454,0,__PYX_ERR(0, 454, __pyx_L1_error))
5391  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 454, __pyx_L1_error)
5392  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5393  __pyx_t_6.memview = NULL;
5394  __pyx_t_6.data = NULL;
5395 
5396  /* "imate/_c_linear_operator/py_c_matrix.pyx":457
5397  *
5398  * # Declare pointers to A.indices ans A.indptr
5399  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5400  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5401  *
5402  */
5403  __Pyx_TraceLine(457,0,__PYX_ERR(0, 457, __pyx_L1_error))
5404  __pyx_t_7 = 0;
5405  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5406 
5407  /* "imate/_c_linear_operator/py_c_matrix.pyx":458
5408  * # Declare pointers to A.indices ans A.indptr
5409  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5410  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5411  *
5412  * # Memoryview of A data
5413  */
5414  __Pyx_TraceLine(458,0,__PYX_ERR(0, 458, __pyx_L1_error))
5415  __pyx_t_7 = 0;
5416  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5417 
5418  /* "imate/_c_linear_operator/py_c_matrix.pyx":461
5419  *
5420  * # Memoryview of A data
5421  * A_data_double_mv = A.data # <<<<<<<<<<<<<<
5422  *
5423  * # Get pointers
5424  */
5425  __Pyx_TraceLine(461,0,__PYX_ERR(0, 461, __pyx_L1_error))
5426  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
5427  __Pyx_GOTREF(__pyx_t_2);
5428  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 461, __pyx_L1_error)
5429  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5430  __pyx_v_A_data_double_mv = __pyx_t_8;
5431  __pyx_t_8.memview = NULL;
5432  __pyx_t_8.data = NULL;
5433 
5434  /* "imate/_c_linear_operator/py_c_matrix.pyx":464
5435  *
5436  * # Get pointers
5437  * A_data_double = &A_data_double_mv[0] # <<<<<<<<<<<<<<
5438  *
5439  * # Create a linear operator object
5440  */
5441  __Pyx_TraceLine(464,0,__PYX_ERR(0, 464, __pyx_L1_error))
5442  __pyx_t_7 = 0;
5443  __pyx_v_A_data_double = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
5444 
5445  /* "imate/_c_linear_operator/py_c_matrix.pyx":467
5446  *
5447  * # Create a linear operator object
5448  * self.Aop_double = new cCSRMatrix[double]( # <<<<<<<<<<<<<<
5449  * A_data_double,
5450  * A_indices,
5451  */
5452  __Pyx_TraceLine(467,0,__PYX_ERR(0, 467, __pyx_L1_error))
5453  try {
5454  __pyx_t_9 = new cCSRMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5455  } catch(...) {
5456  __Pyx_CppExn2PyErr();
5457  __PYX_ERR(0, 467, __pyx_L1_error)
5458  }
5459  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
5460 
5461  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
5462  * # =====================
5463  *
5464  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
5465  * """
5466  * """
5467  */
5468 
5469  /* function exit code */
5470  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5471  goto __pyx_L0;
5472  __pyx_L1_error:;
5473  __Pyx_XDECREF(__pyx_t_1);
5474  __Pyx_XDECREF(__pyx_t_2);
5475  __Pyx_XDECREF(__pyx_t_4);
5476  __Pyx_XDECREF(__pyx_t_5);
5477  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5478  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5479  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5480  __pyx_r = NULL;
5481  __pyx_L0:;
5482  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
5483  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5484  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5485  __Pyx_XGIVEREF(__pyx_r);
5486  __Pyx_TraceReturn(__pyx_r, 0);
5487  __Pyx_RefNannyFinishContext();
5488  return __pyx_r;
5489 }
5490 
5491 /* "imate/_c_linear_operator/py_c_matrix.pyx":478
5492  * # ==========================
5493  *
5494  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5495  * """
5496  * """
5497  */
5498 
5499 /* Python wrapper */
5500 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5501 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double[] = "pycMatrix.set_csr_matrix_long_double(self, A)\n\n ";
5502 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double = {"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double};
5503 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5504  PyObject *__pyx_r = 0;
5505  __Pyx_RefNannyDeclarations
5506  __Pyx_RefNannySetupContext("set_csr_matrix_long_double (wrapper)", 0);
5507  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5508 
5509  /* function exit code */
5510  __Pyx_RefNannyFinishContext();
5511  return __pyx_r;
5512 }
5513 
5514 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5515  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5516  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5517  __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5518  long double *__pyx_v_A_data_long_double;
5519  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5520  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5521  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5522  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5523  PyObject *__pyx_r = NULL;
5524  __Pyx_TraceDeclarations
5525  __Pyx_RefNannyDeclarations
5526  PyObject *__pyx_t_1 = NULL;
5527  PyObject *__pyx_t_2 = NULL;
5528  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5529  PyObject *__pyx_t_4 = NULL;
5530  PyObject *__pyx_t_5 = NULL;
5531  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5532  Py_ssize_t __pyx_t_7;
5533  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5534  cCSRMatrix<long double> *__pyx_t_9;
5535  int __pyx_lineno = 0;
5536  const char *__pyx_filename = NULL;
5537  int __pyx_clineno = 0;
5538  __Pyx_TraceFrameInit(__pyx_codeobj__10)
5539  __Pyx_RefNannySetupContext("set_csr_matrix_long_double", 0);
5540  __Pyx_TraceCall("set_csr_matrix_long_double", __pyx_f[0], 478, 0, __PYX_ERR(0, 478, __pyx_L1_error));
5541 
5542  /* "imate/_c_linear_operator/py_c_matrix.pyx":483
5543  *
5544  * # Matrix size
5545  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5546  * cdef LongIndexType A_num_columns = A.shape[1]
5547  *
5548  */
5549  __Pyx_TraceLine(483,0,__PYX_ERR(0, 483, __pyx_L1_error))
5550  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
5551  __Pyx_GOTREF(__pyx_t_1);
5552  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
5553  __Pyx_GOTREF(__pyx_t_2);
5554  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5555  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 483, __pyx_L1_error)
5556  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5557  __pyx_v_A_num_rows = __pyx_t_3;
5558 
5559  /* "imate/_c_linear_operator/py_c_matrix.pyx":484
5560  * # Matrix size
5561  * cdef LongIndexType A_num_rows = A.shape[0]
5562  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5563  *
5564  * # Declare memoryviews to get pointer of A.data
5565  */
5566  __Pyx_TraceLine(484,0,__PYX_ERR(0, 484, __pyx_L1_error))
5567  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 484, __pyx_L1_error)
5568  __Pyx_GOTREF(__pyx_t_2);
5569  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 484, __pyx_L1_error)
5570  __Pyx_GOTREF(__pyx_t_1);
5571  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5572  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 484, __pyx_L1_error)
5573  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5574  __pyx_v_A_num_columns = __pyx_t_3;
5575 
5576  /* "imate/_c_linear_operator/py_c_matrix.pyx":494
5577  * # If the input type is the same as LongIndexType, no copy is performed.
5578  * self.A_indices_copy = \
5579  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5580  * self.A_index_pointer_copy = \
5581  * A.indptr.astype(self.long_index_type_name, copy=False)
5582  */
5583  __Pyx_TraceLine(494,0,__PYX_ERR(0, 494, __pyx_L1_error))
5584  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5585  __Pyx_GOTREF(__pyx_t_1);
5586  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
5587  __Pyx_GOTREF(__pyx_t_2);
5588  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5589  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5590  __Pyx_GOTREF(__pyx_t_1);
5591  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 494, __pyx_L1_error)
5592  __Pyx_GOTREF(__pyx_t_4);
5593  __Pyx_GIVEREF(__pyx_t_1);
5594  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5595  __pyx_t_1 = 0;
5596  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
5597  __Pyx_GOTREF(__pyx_t_1);
5598  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
5599  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 494, __pyx_L1_error)
5600  __Pyx_GOTREF(__pyx_t_5);
5601  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5602  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5603  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5604 
5605  /* "imate/_c_linear_operator/py_c_matrix.pyx":493
5606  *
5607  * # If the input type is the same as LongIndexType, no copy is performed.
5608  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5609  * A.indices.astype(self.long_index_type_name, copy=False)
5610  * self.A_index_pointer_copy = \
5611  */
5612  __Pyx_TraceLine(493,0,__PYX_ERR(0, 493, __pyx_L1_error))
5613  __Pyx_GIVEREF(__pyx_t_5);
5614  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5615  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5616  __pyx_v_self->A_indices_copy = __pyx_t_5;
5617  __pyx_t_5 = 0;
5618 
5619  /* "imate/_c_linear_operator/py_c_matrix.pyx":496
5620  * A.indices.astype(self.long_index_type_name, copy=False)
5621  * self.A_index_pointer_copy = \
5622  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5623  *
5624  * # Declare memoryviews to get pointer of A.indices and A.indptr
5625  */
5626  __Pyx_TraceLine(496,0,__PYX_ERR(0, 496, __pyx_L1_error))
5627  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5628  __Pyx_GOTREF(__pyx_t_5);
5629  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 496, __pyx_L1_error)
5630  __Pyx_GOTREF(__pyx_t_1);
5631  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5632  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5633  __Pyx_GOTREF(__pyx_t_5);
5634  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 496, __pyx_L1_error)
5635  __Pyx_GOTREF(__pyx_t_4);
5636  __Pyx_GIVEREF(__pyx_t_5);
5637  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5638  __pyx_t_5 = 0;
5639  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 496, __pyx_L1_error)
5640  __Pyx_GOTREF(__pyx_t_5);
5641  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
5642  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
5643  __Pyx_GOTREF(__pyx_t_2);
5644  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5645  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5646  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5647 
5648  /* "imate/_c_linear_operator/py_c_matrix.pyx":495
5649  * self.A_indices_copy = \
5650  * A.indices.astype(self.long_index_type_name, copy=False)
5651  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5652  * A.indptr.astype(self.long_index_type_name, copy=False)
5653  *
5654  */
5655  __Pyx_TraceLine(495,0,__PYX_ERR(0, 495, __pyx_L1_error))
5656  __Pyx_GIVEREF(__pyx_t_2);
5657  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5658  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5659  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5660  __pyx_t_2 = 0;
5661 
5662  /* "imate/_c_linear_operator/py_c_matrix.pyx":499
5663  *
5664  * # Declare memoryviews to get pointer of A.indices and A.indptr
5665  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5666  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5667  * self.A_index_pointer_copy
5668  */
5669  __Pyx_TraceLine(499,0,__PYX_ERR(0, 499, __pyx_L1_error))
5670  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 499, __pyx_L1_error)
5671  __pyx_v_A_indices_mv = __pyx_t_6;
5672  __pyx_t_6.memview = NULL;
5673  __pyx_t_6.data = NULL;
5674 
5675  /* "imate/_c_linear_operator/py_c_matrix.pyx":501
5676  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5677  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5678  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5679  *
5680  * # Declare pointers to A.indices ans A.indptr
5681  */
5682  __Pyx_TraceLine(501,0,__PYX_ERR(0, 501, __pyx_L1_error))
5683  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 501, __pyx_L1_error)
5684  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5685  __pyx_t_6.memview = NULL;
5686  __pyx_t_6.data = NULL;
5687 
5688  /* "imate/_c_linear_operator/py_c_matrix.pyx":504
5689  *
5690  * # Declare pointers to A.indices ans A.indptr
5691  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5692  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5693  *
5694  */
5695  __Pyx_TraceLine(504,0,__PYX_ERR(0, 504, __pyx_L1_error))
5696  __pyx_t_7 = 0;
5697  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5698 
5699  /* "imate/_c_linear_operator/py_c_matrix.pyx":505
5700  * # Declare pointers to A.indices ans A.indptr
5701  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5702  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5703  *
5704  * # Memoryview of A data
5705  */
5706  __Pyx_TraceLine(505,0,__PYX_ERR(0, 505, __pyx_L1_error))
5707  __pyx_t_7 = 0;
5708  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
5709 
5710  /* "imate/_c_linear_operator/py_c_matrix.pyx":508
5711  *
5712  * # Memoryview of A data
5713  * A_data_long_double_mv = A.data # <<<<<<<<<<<<<<
5714  *
5715  * # Get pointers
5716  */
5717  __Pyx_TraceLine(508,0,__PYX_ERR(0, 508, __pyx_L1_error))
5718  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 508, __pyx_L1_error)
5719  __Pyx_GOTREF(__pyx_t_2);
5720  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 508, __pyx_L1_error)
5721  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5722  __pyx_v_A_data_long_double_mv = __pyx_t_8;
5723  __pyx_t_8.memview = NULL;
5724  __pyx_t_8.data = NULL;
5725 
5726  /* "imate/_c_linear_operator/py_c_matrix.pyx":511
5727  *
5728  * # Get pointers
5729  * A_data_long_double = &A_data_long_double_mv[0] # <<<<<<<<<<<<<<
5730  *
5731  * # Create a linear operator object
5732  */
5733  __Pyx_TraceLine(511,0,__PYX_ERR(0, 511, __pyx_L1_error))
5734  __pyx_t_7 = 0;
5735  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
5736 
5737  /* "imate/_c_linear_operator/py_c_matrix.pyx":514
5738  *
5739  * # Create a linear operator object
5740  * self.Aop_long_double = new cCSRMatrix[long double]( # <<<<<<<<<<<<<<
5741  * A_data_long_double,
5742  * A_indices,
5743  */
5744  __Pyx_TraceLine(514,0,__PYX_ERR(0, 514, __pyx_L1_error))
5745  try {
5746  __pyx_t_9 = new cCSRMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
5747  } catch(...) {
5748  __Pyx_CppExn2PyErr();
5749  __PYX_ERR(0, 514, __pyx_L1_error)
5750  }
5751  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
5752 
5753  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
5754  * # ==========================
5755  *
5756  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
5757  * """
5758  * """
5759  */
5760 
5761  /* function exit code */
5762  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5763  goto __pyx_L0;
5764  __pyx_L1_error:;
5765  __Pyx_XDECREF(__pyx_t_1);
5766  __Pyx_XDECREF(__pyx_t_2);
5767  __Pyx_XDECREF(__pyx_t_4);
5768  __Pyx_XDECREF(__pyx_t_5);
5769  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
5770  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
5771  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csr_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
5772  __pyx_r = NULL;
5773  __pyx_L0:;
5774  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
5775  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
5776  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
5777  __Pyx_XGIVEREF(__pyx_r);
5778  __Pyx_TraceReturn(__pyx_r, 0);
5779  __Pyx_RefNannyFinishContext();
5780  return __pyx_r;
5781 }
5782 
5783 /* "imate/_c_linear_operator/py_c_matrix.pyx":525
5784  * # ====================
5785  *
5786  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
5787  * """
5788  * """
5789  */
5790 
5791 /* Python wrapper */
5792 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
5793 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float[] = "pycMatrix.set_csc_matrix_float(self, A)\n\n ";
5794 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float = {"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float};
5795 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
5796  PyObject *__pyx_r = 0;
5797  __Pyx_RefNannyDeclarations
5798  __Pyx_RefNannySetupContext("set_csc_matrix_float (wrapper)", 0);
5799  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
5800 
5801  /* function exit code */
5802  __Pyx_RefNannyFinishContext();
5803  return __pyx_r;
5804 }
5805 
5806 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
5807  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
5808  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
5809  __Pyx_memviewslice __pyx_v_A_data_float_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5810  float *__pyx_v_A_data_float;
5811  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5812  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
5813  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
5814  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
5815  PyObject *__pyx_r = NULL;
5816  __Pyx_TraceDeclarations
5817  __Pyx_RefNannyDeclarations
5818  PyObject *__pyx_t_1 = NULL;
5819  PyObject *__pyx_t_2 = NULL;
5820  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
5821  PyObject *__pyx_t_4 = NULL;
5822  PyObject *__pyx_t_5 = NULL;
5823  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
5824  Py_ssize_t __pyx_t_7;
5825  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
5826  cCSCMatrix<float> *__pyx_t_9;
5827  int __pyx_lineno = 0;
5828  const char *__pyx_filename = NULL;
5829  int __pyx_clineno = 0;
5830  __Pyx_TraceFrameInit(__pyx_codeobj__11)
5831  __Pyx_RefNannySetupContext("set_csc_matrix_float", 0);
5832  __Pyx_TraceCall("set_csc_matrix_float", __pyx_f[0], 525, 0, __PYX_ERR(0, 525, __pyx_L1_error));
5833 
5834  /* "imate/_c_linear_operator/py_c_matrix.pyx":530
5835  *
5836  * # Matrix size
5837  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
5838  * cdef LongIndexType A_num_columns = A.shape[1]
5839  *
5840  */
5841  __Pyx_TraceLine(530,0,__PYX_ERR(0, 530, __pyx_L1_error))
5842  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 530, __pyx_L1_error)
5843  __Pyx_GOTREF(__pyx_t_1);
5844  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 530, __pyx_L1_error)
5845  __Pyx_GOTREF(__pyx_t_2);
5846  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5847  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 530, __pyx_L1_error)
5848  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5849  __pyx_v_A_num_rows = __pyx_t_3;
5850 
5851  /* "imate/_c_linear_operator/py_c_matrix.pyx":531
5852  * # Matrix size
5853  * cdef LongIndexType A_num_rows = A.shape[0]
5854  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
5855  *
5856  * # Declare memoryviews to get pointer of A.data
5857  */
5858  __Pyx_TraceLine(531,0,__PYX_ERR(0, 531, __pyx_L1_error))
5859  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 531, __pyx_L1_error)
5860  __Pyx_GOTREF(__pyx_t_2);
5861  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 531, __pyx_L1_error)
5862  __Pyx_GOTREF(__pyx_t_1);
5863  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5864  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 531, __pyx_L1_error)
5865  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5866  __pyx_v_A_num_columns = __pyx_t_3;
5867 
5868  /* "imate/_c_linear_operator/py_c_matrix.pyx":541
5869  * # If the input type is the same as LongIndexType, no copy is performed.
5870  * self.A_indices_copy = \
5871  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5872  * self.A_index_pointer_copy = \
5873  * A.indptr.astype(self.long_index_type_name, copy=False)
5874  */
5875  __Pyx_TraceLine(541,0,__PYX_ERR(0, 541, __pyx_L1_error))
5876  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
5877  __Pyx_GOTREF(__pyx_t_1);
5878  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
5879  __Pyx_GOTREF(__pyx_t_2);
5880  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5881  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
5882  __Pyx_GOTREF(__pyx_t_1);
5883  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
5884  __Pyx_GOTREF(__pyx_t_4);
5885  __Pyx_GIVEREF(__pyx_t_1);
5886  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
5887  __pyx_t_1 = 0;
5888  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 541, __pyx_L1_error)
5889  __Pyx_GOTREF(__pyx_t_1);
5890  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 541, __pyx_L1_error)
5891  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 541, __pyx_L1_error)
5892  __Pyx_GOTREF(__pyx_t_5);
5893  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5894  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5895  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5896 
5897  /* "imate/_c_linear_operator/py_c_matrix.pyx":540
5898  *
5899  * # If the input type is the same as LongIndexType, no copy is performed.
5900  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
5901  * A.indices.astype(self.long_index_type_name, copy=False)
5902  * self.A_index_pointer_copy = \
5903  */
5904  __Pyx_TraceLine(540,0,__PYX_ERR(0, 540, __pyx_L1_error))
5905  __Pyx_GIVEREF(__pyx_t_5);
5906  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
5907  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
5908  __pyx_v_self->A_indices_copy = __pyx_t_5;
5909  __pyx_t_5 = 0;
5910 
5911  /* "imate/_c_linear_operator/py_c_matrix.pyx":543
5912  * A.indices.astype(self.long_index_type_name, copy=False)
5913  * self.A_index_pointer_copy = \
5914  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
5915  *
5916  * # Declare memoryviews to get pointer of A.indices and A.indptr
5917  */
5918  __Pyx_TraceLine(543,0,__PYX_ERR(0, 543, __pyx_L1_error))
5919  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
5920  __Pyx_GOTREF(__pyx_t_5);
5921  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 543, __pyx_L1_error)
5922  __Pyx_GOTREF(__pyx_t_1);
5923  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5924  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
5925  __Pyx_GOTREF(__pyx_t_5);
5926  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 543, __pyx_L1_error)
5927  __Pyx_GOTREF(__pyx_t_4);
5928  __Pyx_GIVEREF(__pyx_t_5);
5929  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
5930  __pyx_t_5 = 0;
5931  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 543, __pyx_L1_error)
5932  __Pyx_GOTREF(__pyx_t_5);
5933  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 543, __pyx_L1_error)
5934  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 543, __pyx_L1_error)
5935  __Pyx_GOTREF(__pyx_t_2);
5936  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5937  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5938  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5939 
5940  /* "imate/_c_linear_operator/py_c_matrix.pyx":542
5941  * self.A_indices_copy = \
5942  * A.indices.astype(self.long_index_type_name, copy=False)
5943  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
5944  * A.indptr.astype(self.long_index_type_name, copy=False)
5945  *
5946  */
5947  __Pyx_TraceLine(542,0,__PYX_ERR(0, 542, __pyx_L1_error))
5948  __Pyx_GIVEREF(__pyx_t_2);
5949  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
5950  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
5951  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
5952  __pyx_t_2 = 0;
5953 
5954  /* "imate/_c_linear_operator/py_c_matrix.pyx":546
5955  *
5956  * # Declare memoryviews to get pointer of A.indices and A.indptr
5957  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
5958  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5959  * self.A_index_pointer_copy
5960  */
5961  __Pyx_TraceLine(546,0,__PYX_ERR(0, 546, __pyx_L1_error))
5962  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 546, __pyx_L1_error)
5963  __pyx_v_A_indices_mv = __pyx_t_6;
5964  __pyx_t_6.memview = NULL;
5965  __pyx_t_6.data = NULL;
5966 
5967  /* "imate/_c_linear_operator/py_c_matrix.pyx":548
5968  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
5969  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
5970  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
5971  *
5972  * # Declare pointers to A.indices ans A.indptr
5973  */
5974  __Pyx_TraceLine(548,0,__PYX_ERR(0, 548, __pyx_L1_error))
5975  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 548, __pyx_L1_error)
5976  __pyx_v_A_index_pointer_mv = __pyx_t_6;
5977  __pyx_t_6.memview = NULL;
5978  __pyx_t_6.data = NULL;
5979 
5980  /* "imate/_c_linear_operator/py_c_matrix.pyx":551
5981  *
5982  * # Declare pointers to A.indices ans A.indptr
5983  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
5984  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
5985  *
5986  */
5987  __Pyx_TraceLine(551,0,__PYX_ERR(0, 551, __pyx_L1_error))
5988  __pyx_t_7 = 0;
5989  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
5990 
5991  /* "imate/_c_linear_operator/py_c_matrix.pyx":552
5992  * # Declare pointers to A.indices ans A.indptr
5993  * cdef LongIndexType* A_indices = &A_indices_mv[0]
5994  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
5995  *
5996  * # Memoryview of A data
5997  */
5998  __Pyx_TraceLine(552,0,__PYX_ERR(0, 552, __pyx_L1_error))
5999  __pyx_t_7 = 0;
6000  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6001 
6002  /* "imate/_c_linear_operator/py_c_matrix.pyx":555
6003  *
6004  * # Memoryview of A data
6005  * A_data_float_mv = A.data # <<<<<<<<<<<<<<
6006  *
6007  * # Get pointers
6008  */
6009  __Pyx_TraceLine(555,0,__PYX_ERR(0, 555, __pyx_L1_error))
6010  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 555, __pyx_L1_error)
6011  __Pyx_GOTREF(__pyx_t_2);
6012  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_float(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 555, __pyx_L1_error)
6013  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6014  __pyx_v_A_data_float_mv = __pyx_t_8;
6015  __pyx_t_8.memview = NULL;
6016  __pyx_t_8.data = NULL;
6017 
6018  /* "imate/_c_linear_operator/py_c_matrix.pyx":558
6019  *
6020  * # Get pointers
6021  * A_data_float = &A_data_float_mv[0] # <<<<<<<<<<<<<<
6022  *
6023  * # Create a linear operator object
6024  */
6025  __Pyx_TraceLine(558,0,__PYX_ERR(0, 558, __pyx_L1_error))
6026  __pyx_t_7 = 0;
6027  __pyx_v_A_data_float = (&(*((float *) ( /* dim=0 */ (__pyx_v_A_data_float_mv.data + __pyx_t_7 * __pyx_v_A_data_float_mv.strides[0]) ))));
6028 
6029  /* "imate/_c_linear_operator/py_c_matrix.pyx":561
6030  *
6031  * # Create a linear operator object
6032  * self.Aop_float = new cCSCMatrix[float]( # <<<<<<<<<<<<<<
6033  * A_data_float,
6034  * A_indices,
6035  */
6036  __Pyx_TraceLine(561,0,__PYX_ERR(0, 561, __pyx_L1_error))
6037  try {
6038  __pyx_t_9 = new cCSCMatrix<float> (__pyx_v_A_data_float, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6039  } catch(...) {
6040  __Pyx_CppExn2PyErr();
6041  __PYX_ERR(0, 561, __pyx_L1_error)
6042  }
6043  __pyx_v_self->__pyx_base.Aop_float = __pyx_t_9;
6044 
6045  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
6046  * # ====================
6047  *
6048  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
6049  * """
6050  * """
6051  */
6052 
6053  /* function exit code */
6054  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6055  goto __pyx_L0;
6056  __pyx_L1_error:;
6057  __Pyx_XDECREF(__pyx_t_1);
6058  __Pyx_XDECREF(__pyx_t_2);
6059  __Pyx_XDECREF(__pyx_t_4);
6060  __Pyx_XDECREF(__pyx_t_5);
6061  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6062  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6063  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_float", __pyx_clineno, __pyx_lineno, __pyx_filename);
6064  __pyx_r = NULL;
6065  __pyx_L0:;
6066  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_float_mv, 1);
6067  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6068  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6069  __Pyx_XGIVEREF(__pyx_r);
6070  __Pyx_TraceReturn(__pyx_r, 0);
6071  __Pyx_RefNannyFinishContext();
6072  return __pyx_r;
6073 }
6074 
6075 /* "imate/_c_linear_operator/py_c_matrix.pyx":572
6076  * # =====================
6077  *
6078  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
6079  * """
6080  * """
6081  */
6082 
6083 /* Python wrapper */
6084 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6085 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double[] = "pycMatrix.set_csc_matrix_double(self, A)\n\n ";
6086 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double = {"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double};
6087 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6088  PyObject *__pyx_r = 0;
6089  __Pyx_RefNannyDeclarations
6090  __Pyx_RefNannySetupContext("set_csc_matrix_double (wrapper)", 0);
6091  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6092 
6093  /* function exit code */
6094  __Pyx_RefNannyFinishContext();
6095  return __pyx_r;
6096 }
6097 
6098 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6099  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6100  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6101  __Pyx_memviewslice __pyx_v_A_data_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6102  double *__pyx_v_A_data_double;
6103  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6104  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6105  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6106  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6107  PyObject *__pyx_r = NULL;
6108  __Pyx_TraceDeclarations
6109  __Pyx_RefNannyDeclarations
6110  PyObject *__pyx_t_1 = NULL;
6111  PyObject *__pyx_t_2 = NULL;
6112  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6113  PyObject *__pyx_t_4 = NULL;
6114  PyObject *__pyx_t_5 = NULL;
6115  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6116  Py_ssize_t __pyx_t_7;
6117  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6118  cCSCMatrix<double> *__pyx_t_9;
6119  int __pyx_lineno = 0;
6120  const char *__pyx_filename = NULL;
6121  int __pyx_clineno = 0;
6122  __Pyx_TraceFrameInit(__pyx_codeobj__12)
6123  __Pyx_RefNannySetupContext("set_csc_matrix_double", 0);
6124  __Pyx_TraceCall("set_csc_matrix_double", __pyx_f[0], 572, 0, __PYX_ERR(0, 572, __pyx_L1_error));
6125 
6126  /* "imate/_c_linear_operator/py_c_matrix.pyx":577
6127  *
6128  * # Matrix size
6129  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6130  * cdef LongIndexType A_num_columns = A.shape[1]
6131  *
6132  */
6133  __Pyx_TraceLine(577,0,__PYX_ERR(0, 577, __pyx_L1_error))
6134  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 577, __pyx_L1_error)
6135  __Pyx_GOTREF(__pyx_t_1);
6136  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 577, __pyx_L1_error)
6137  __Pyx_GOTREF(__pyx_t_2);
6138  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6139  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 577, __pyx_L1_error)
6140  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6141  __pyx_v_A_num_rows = __pyx_t_3;
6142 
6143  /* "imate/_c_linear_operator/py_c_matrix.pyx":578
6144  * # Matrix size
6145  * cdef LongIndexType A_num_rows = A.shape[0]
6146  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6147  *
6148  * # Declare memoryviews to get pointer of A.data
6149  */
6150  __Pyx_TraceLine(578,0,__PYX_ERR(0, 578, __pyx_L1_error))
6151  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 578, __pyx_L1_error)
6152  __Pyx_GOTREF(__pyx_t_2);
6153  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
6154  __Pyx_GOTREF(__pyx_t_1);
6155  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6156  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 578, __pyx_L1_error)
6157  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6158  __pyx_v_A_num_columns = __pyx_t_3;
6159 
6160  /* "imate/_c_linear_operator/py_c_matrix.pyx":588
6161  * # If the input type is the same as LongIndexType, no copy is performed.
6162  * self.A_indices_copy = \
6163  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6164  * self.A_index_pointer_copy = \
6165  * A.indptr.astype(self.long_index_type_name, copy=False)
6166  */
6167  __Pyx_TraceLine(588,0,__PYX_ERR(0, 588, __pyx_L1_error))
6168  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6169  __Pyx_GOTREF(__pyx_t_1);
6170  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 588, __pyx_L1_error)
6171  __Pyx_GOTREF(__pyx_t_2);
6172  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6173  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6174  __Pyx_GOTREF(__pyx_t_1);
6175  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 588, __pyx_L1_error)
6176  __Pyx_GOTREF(__pyx_t_4);
6177  __Pyx_GIVEREF(__pyx_t_1);
6178  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6179  __pyx_t_1 = 0;
6180  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 588, __pyx_L1_error)
6181  __Pyx_GOTREF(__pyx_t_1);
6182  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 588, __pyx_L1_error)
6183  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 588, __pyx_L1_error)
6184  __Pyx_GOTREF(__pyx_t_5);
6185  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6186  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6187  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6188 
6189  /* "imate/_c_linear_operator/py_c_matrix.pyx":587
6190  *
6191  * # If the input type is the same as LongIndexType, no copy is performed.
6192  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6193  * A.indices.astype(self.long_index_type_name, copy=False)
6194  * self.A_index_pointer_copy = \
6195  */
6196  __Pyx_TraceLine(587,0,__PYX_ERR(0, 587, __pyx_L1_error))
6197  __Pyx_GIVEREF(__pyx_t_5);
6198  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6199  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6200  __pyx_v_self->A_indices_copy = __pyx_t_5;
6201  __pyx_t_5 = 0;
6202 
6203  /* "imate/_c_linear_operator/py_c_matrix.pyx":590
6204  * A.indices.astype(self.long_index_type_name, copy=False)
6205  * self.A_index_pointer_copy = \
6206  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6207  *
6208  * # Declare memoryviews to get pointer of A.indices and A.indptr
6209  */
6210  __Pyx_TraceLine(590,0,__PYX_ERR(0, 590, __pyx_L1_error))
6211  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6212  __Pyx_GOTREF(__pyx_t_5);
6213  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 590, __pyx_L1_error)
6214  __Pyx_GOTREF(__pyx_t_1);
6215  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6216  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6217  __Pyx_GOTREF(__pyx_t_5);
6218  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 590, __pyx_L1_error)
6219  __Pyx_GOTREF(__pyx_t_4);
6220  __Pyx_GIVEREF(__pyx_t_5);
6221  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6222  __pyx_t_5 = 0;
6223  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 590, __pyx_L1_error)
6224  __Pyx_GOTREF(__pyx_t_5);
6225  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 590, __pyx_L1_error)
6226  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 590, __pyx_L1_error)
6227  __Pyx_GOTREF(__pyx_t_2);
6228  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6229  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6230  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6231 
6232  /* "imate/_c_linear_operator/py_c_matrix.pyx":589
6233  * self.A_indices_copy = \
6234  * A.indices.astype(self.long_index_type_name, copy=False)
6235  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6236  * A.indptr.astype(self.long_index_type_name, copy=False)
6237  *
6238  */
6239  __Pyx_TraceLine(589,0,__PYX_ERR(0, 589, __pyx_L1_error))
6240  __Pyx_GIVEREF(__pyx_t_2);
6241  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6242  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6243  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6244  __pyx_t_2 = 0;
6245 
6246  /* "imate/_c_linear_operator/py_c_matrix.pyx":593
6247  *
6248  * # Declare memoryviews to get pointer of A.indices and A.indptr
6249  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6250  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6251  * self.A_index_pointer_copy
6252  */
6253  __Pyx_TraceLine(593,0,__PYX_ERR(0, 593, __pyx_L1_error))
6254  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 593, __pyx_L1_error)
6255  __pyx_v_A_indices_mv = __pyx_t_6;
6256  __pyx_t_6.memview = NULL;
6257  __pyx_t_6.data = NULL;
6258 
6259  /* "imate/_c_linear_operator/py_c_matrix.pyx":595
6260  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6261  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6262  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6263  *
6264  * # Declare pointers to A.indices ans A.indptr
6265  */
6266  __Pyx_TraceLine(595,0,__PYX_ERR(0, 595, __pyx_L1_error))
6267  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 595, __pyx_L1_error)
6268  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6269  __pyx_t_6.memview = NULL;
6270  __pyx_t_6.data = NULL;
6271 
6272  /* "imate/_c_linear_operator/py_c_matrix.pyx":598
6273  *
6274  * # Declare pointers to A.indices ans A.indptr
6275  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6276  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6277  *
6278  */
6279  __Pyx_TraceLine(598,0,__PYX_ERR(0, 598, __pyx_L1_error))
6280  __pyx_t_7 = 0;
6281  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6282 
6283  /* "imate/_c_linear_operator/py_c_matrix.pyx":599
6284  * # Declare pointers to A.indices ans A.indptr
6285  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6286  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6287  *
6288  * # Memoryview of A data
6289  */
6290  __Pyx_TraceLine(599,0,__PYX_ERR(0, 599, __pyx_L1_error))
6291  __pyx_t_7 = 0;
6292  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6293 
6294  /* "imate/_c_linear_operator/py_c_matrix.pyx":602
6295  *
6296  * # Memoryview of A data
6297  * A_data_double_mv = A.data # <<<<<<<<<<<<<<
6298  *
6299  * # Get pointers
6300  */
6301  __Pyx_TraceLine(602,0,__PYX_ERR(0, 602, __pyx_L1_error))
6302  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
6303  __Pyx_GOTREF(__pyx_t_2);
6304  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 602, __pyx_L1_error)
6305  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6306  __pyx_v_A_data_double_mv = __pyx_t_8;
6307  __pyx_t_8.memview = NULL;
6308  __pyx_t_8.data = NULL;
6309 
6310  /* "imate/_c_linear_operator/py_c_matrix.pyx":605
6311  *
6312  * # Get pointers
6313  * A_data_double = &A_data_double_mv[0] # <<<<<<<<<<<<<<
6314  *
6315  * # Create a linear operator object
6316  */
6317  __Pyx_TraceLine(605,0,__PYX_ERR(0, 605, __pyx_L1_error))
6318  __pyx_t_7 = 0;
6319  __pyx_v_A_data_double = (&(*((double *) ( /* dim=0 */ (__pyx_v_A_data_double_mv.data + __pyx_t_7 * __pyx_v_A_data_double_mv.strides[0]) ))));
6320 
6321  /* "imate/_c_linear_operator/py_c_matrix.pyx":608
6322  *
6323  * # Create a linear operator object
6324  * self.Aop_double = new cCSCMatrix[double]( # <<<<<<<<<<<<<<
6325  * A_data_double,
6326  * A_indices,
6327  */
6328  __Pyx_TraceLine(608,0,__PYX_ERR(0, 608, __pyx_L1_error))
6329  try {
6330  __pyx_t_9 = new cCSCMatrix<double> (__pyx_v_A_data_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6331  } catch(...) {
6332  __Pyx_CppExn2PyErr();
6333  __PYX_ERR(0, 608, __pyx_L1_error)
6334  }
6335  __pyx_v_self->__pyx_base.Aop_double = __pyx_t_9;
6336 
6337  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
6338  * # =====================
6339  *
6340  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
6341  * """
6342  * """
6343  */
6344 
6345  /* function exit code */
6346  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6347  goto __pyx_L0;
6348  __pyx_L1_error:;
6349  __Pyx_XDECREF(__pyx_t_1);
6350  __Pyx_XDECREF(__pyx_t_2);
6351  __Pyx_XDECREF(__pyx_t_4);
6352  __Pyx_XDECREF(__pyx_t_5);
6353  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6354  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6355  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6356  __pyx_r = NULL;
6357  __pyx_L0:;
6358  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_double_mv, 1);
6359  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6360  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6361  __Pyx_XGIVEREF(__pyx_r);
6362  __Pyx_TraceReturn(__pyx_r, 0);
6363  __Pyx_RefNannyFinishContext();
6364  return __pyx_r;
6365 }
6366 
6367 /* "imate/_c_linear_operator/py_c_matrix.pyx":619
6368  * # ==========================
6369  *
6370  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6371  * """
6372  * """
6373  */
6374 
6375 /* Python wrapper */
6376 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A); /*proto*/
6377 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double[] = "pycMatrix.set_csc_matrix_long_double(self, A)\n\n ";
6378 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double = {"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double};
6379 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double(PyObject *__pyx_v_self, PyObject *__pyx_v_A) {
6380  PyObject *__pyx_r = 0;
6381  __Pyx_RefNannyDeclarations
6382  __Pyx_RefNannySetupContext("set_csc_matrix_long_double (wrapper)", 0);
6383  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v_A));
6384 
6385  /* function exit code */
6386  __Pyx_RefNannyFinishContext();
6387  return __pyx_r;
6388 }
6389 
6390 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, PyObject *__pyx_v_A) {
6391  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_rows;
6392  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_v_A_num_columns;
6393  __Pyx_memviewslice __pyx_v_A_data_long_double_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6394  long double *__pyx_v_A_data_long_double;
6395  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_indices_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6396  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_v_A_index_pointer_mv = { 0, 0, { 0 }, { 0 }, { 0 } };
6397  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_indices;
6398  __pyx_t_5imate_12_definitions_5types_LongIndexType *__pyx_v_A_index_pointer;
6399  PyObject *__pyx_r = NULL;
6400  __Pyx_TraceDeclarations
6401  __Pyx_RefNannyDeclarations
6402  PyObject *__pyx_t_1 = NULL;
6403  PyObject *__pyx_t_2 = NULL;
6404  __pyx_t_5imate_12_definitions_5types_LongIndexType __pyx_t_3;
6405  PyObject *__pyx_t_4 = NULL;
6406  PyObject *__pyx_t_5 = NULL;
6407  __pyx_t_5imate_12_definitions_5types_MemoryViewLongIndexType __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
6408  Py_ssize_t __pyx_t_7;
6409  __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
6410  cCSCMatrix<long double> *__pyx_t_9;
6411  int __pyx_lineno = 0;
6412  const char *__pyx_filename = NULL;
6413  int __pyx_clineno = 0;
6414  __Pyx_TraceFrameInit(__pyx_codeobj__13)
6415  __Pyx_RefNannySetupContext("set_csc_matrix_long_double", 0);
6416  __Pyx_TraceCall("set_csc_matrix_long_double", __pyx_f[0], 619, 0, __PYX_ERR(0, 619, __pyx_L1_error));
6417 
6418  /* "imate/_c_linear_operator/py_c_matrix.pyx":624
6419  *
6420  * # Matrix size
6421  * cdef LongIndexType A_num_rows = A.shape[0] # <<<<<<<<<<<<<<
6422  * cdef LongIndexType A_num_columns = A.shape[1]
6423  *
6424  */
6425  __Pyx_TraceLine(624,0,__PYX_ERR(0, 624, __pyx_L1_error))
6426  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
6427  __Pyx_GOTREF(__pyx_t_1);
6428  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 624, __pyx_L1_error)
6429  __Pyx_GOTREF(__pyx_t_2);
6430  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6431  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 624, __pyx_L1_error)
6432  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6433  __pyx_v_A_num_rows = __pyx_t_3;
6434 
6435  /* "imate/_c_linear_operator/py_c_matrix.pyx":625
6436  * # Matrix size
6437  * cdef LongIndexType A_num_rows = A.shape[0]
6438  * cdef LongIndexType A_num_columns = A.shape[1] # <<<<<<<<<<<<<<
6439  *
6440  * # Declare memoryviews to get pointer of A.data
6441  */
6442  __Pyx_TraceLine(625,0,__PYX_ERR(0, 625, __pyx_L1_error))
6443  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_shape); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 625, __pyx_L1_error)
6444  __Pyx_GOTREF(__pyx_t_2);
6445  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 625, __pyx_L1_error)
6446  __Pyx_GOTREF(__pyx_t_1);
6447  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6448  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 625, __pyx_L1_error)
6449  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6450  __pyx_v_A_num_columns = __pyx_t_3;
6451 
6452  /* "imate/_c_linear_operator/py_c_matrix.pyx":635
6453  * # If the input type is the same as LongIndexType, no copy is performed.
6454  * self.A_indices_copy = \
6455  * A.indices.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6456  * self.A_index_pointer_copy = \
6457  * A.indptr.astype(self.long_index_type_name, copy=False)
6458  */
6459  __Pyx_TraceLine(635,0,__PYX_ERR(0, 635, __pyx_L1_error))
6460  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indices); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6461  __Pyx_GOTREF(__pyx_t_1);
6462  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_astype); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 635, __pyx_L1_error)
6463  __Pyx_GOTREF(__pyx_t_2);
6464  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6465  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6466  __Pyx_GOTREF(__pyx_t_1);
6467  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 635, __pyx_L1_error)
6468  __Pyx_GOTREF(__pyx_t_4);
6469  __Pyx_GIVEREF(__pyx_t_1);
6470  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
6471  __pyx_t_1 = 0;
6472  __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 635, __pyx_L1_error)
6473  __Pyx_GOTREF(__pyx_t_1);
6474  if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 635, __pyx_L1_error)
6475  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 635, __pyx_L1_error)
6476  __Pyx_GOTREF(__pyx_t_5);
6477  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6478  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6479  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6480 
6481  /* "imate/_c_linear_operator/py_c_matrix.pyx":634
6482  *
6483  * # If the input type is the same as LongIndexType, no copy is performed.
6484  * self.A_indices_copy = \ # <<<<<<<<<<<<<<
6485  * A.indices.astype(self.long_index_type_name, copy=False)
6486  * self.A_index_pointer_copy = \
6487  */
6488  __Pyx_TraceLine(634,0,__PYX_ERR(0, 634, __pyx_L1_error))
6489  __Pyx_GIVEREF(__pyx_t_5);
6490  __Pyx_GOTREF(__pyx_v_self->A_indices_copy);
6491  __Pyx_DECREF(__pyx_v_self->A_indices_copy);
6492  __pyx_v_self->A_indices_copy = __pyx_t_5;
6493  __pyx_t_5 = 0;
6494 
6495  /* "imate/_c_linear_operator/py_c_matrix.pyx":637
6496  * A.indices.astype(self.long_index_type_name, copy=False)
6497  * self.A_index_pointer_copy = \
6498  * A.indptr.astype(self.long_index_type_name, copy=False) # <<<<<<<<<<<<<<
6499  *
6500  * # Declare memoryviews to get pointer of A.indices and A.indptr
6501  */
6502  __Pyx_TraceLine(637,0,__PYX_ERR(0, 637, __pyx_L1_error))
6503  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_indptr); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6504  __Pyx_GOTREF(__pyx_t_5);
6505  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_astype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 637, __pyx_L1_error)
6506  __Pyx_GOTREF(__pyx_t_1);
6507  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6508  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->__pyx_base.long_index_type_name); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6509  __Pyx_GOTREF(__pyx_t_5);
6510  __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 637, __pyx_L1_error)
6511  __Pyx_GOTREF(__pyx_t_4);
6512  __Pyx_GIVEREF(__pyx_t_5);
6513  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
6514  __pyx_t_5 = 0;
6515  __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 637, __pyx_L1_error)
6516  __Pyx_GOTREF(__pyx_t_5);
6517  if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_copy, Py_False) < 0) __PYX_ERR(0, 637, __pyx_L1_error)
6518  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 637, __pyx_L1_error)
6519  __Pyx_GOTREF(__pyx_t_2);
6520  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6521  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6522  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6523 
6524  /* "imate/_c_linear_operator/py_c_matrix.pyx":636
6525  * self.A_indices_copy = \
6526  * A.indices.astype(self.long_index_type_name, copy=False)
6527  * self.A_index_pointer_copy = \ # <<<<<<<<<<<<<<
6528  * A.indptr.astype(self.long_index_type_name, copy=False)
6529  *
6530  */
6531  __Pyx_TraceLine(636,0,__PYX_ERR(0, 636, __pyx_L1_error))
6532  __Pyx_GIVEREF(__pyx_t_2);
6533  __Pyx_GOTREF(__pyx_v_self->A_index_pointer_copy);
6534  __Pyx_DECREF(__pyx_v_self->A_index_pointer_copy);
6535  __pyx_v_self->A_index_pointer_copy = __pyx_t_2;
6536  __pyx_t_2 = 0;
6537 
6538  /* "imate/_c_linear_operator/py_c_matrix.pyx":640
6539  *
6540  * # Declare memoryviews to get pointer of A.indices and A.indptr
6541  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy # <<<<<<<<<<<<<<
6542  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6543  * self.A_index_pointer_copy
6544  */
6545  __Pyx_TraceLine(640,0,__PYX_ERR(0, 640, __pyx_L1_error))
6546  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_indices_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 640, __pyx_L1_error)
6547  __pyx_v_A_indices_mv = __pyx_t_6;
6548  __pyx_t_6.memview = NULL;
6549  __pyx_t_6.data = NULL;
6550 
6551  /* "imate/_c_linear_operator/py_c_matrix.pyx":642
6552  * cdef MemoryViewLongIndexType A_indices_mv = self.A_indices_copy
6553  * cdef MemoryViewLongIndexType A_index_pointer_mv = \
6554  * self.A_index_pointer_copy # <<<<<<<<<<<<<<
6555  *
6556  * # Declare pointers to A.indices ans A.indptr
6557  */
6558  __Pyx_TraceLine(642,0,__PYX_ERR(0, 642, __pyx_L1_error))
6559  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_v_self->A_index_pointer_copy, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 642, __pyx_L1_error)
6560  __pyx_v_A_index_pointer_mv = __pyx_t_6;
6561  __pyx_t_6.memview = NULL;
6562  __pyx_t_6.data = NULL;
6563 
6564  /* "imate/_c_linear_operator/py_c_matrix.pyx":645
6565  *
6566  * # Declare pointers to A.indices ans A.indptr
6567  * cdef LongIndexType* A_indices = &A_indices_mv[0] # <<<<<<<<<<<<<<
6568  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0]
6569  *
6570  */
6571  __Pyx_TraceLine(645,0,__PYX_ERR(0, 645, __pyx_L1_error))
6572  __pyx_t_7 = 0;
6573  __pyx_v_A_indices = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_indices_mv.data + __pyx_t_7 * __pyx_v_A_indices_mv.strides[0]) ))));
6574 
6575  /* "imate/_c_linear_operator/py_c_matrix.pyx":646
6576  * # Declare pointers to A.indices ans A.indptr
6577  * cdef LongIndexType* A_indices = &A_indices_mv[0]
6578  * cdef LongIndexType* A_index_pointer = &A_index_pointer_mv[0] # <<<<<<<<<<<<<<
6579  *
6580  * # Memoryview of A data
6581  */
6582  __Pyx_TraceLine(646,0,__PYX_ERR(0, 646, __pyx_L1_error))
6583  __pyx_t_7 = 0;
6584  __pyx_v_A_index_pointer = (&(*((int *) ( /* dim=0 */ (__pyx_v_A_index_pointer_mv.data + __pyx_t_7 * __pyx_v_A_index_pointer_mv.strides[0]) ))));
6585 
6586  /* "imate/_c_linear_operator/py_c_matrix.pyx":649
6587  *
6588  * # Memoryview of A data
6589  * A_data_long_double_mv = A.data # <<<<<<<<<<<<<<
6590  *
6591  * # Get pointers
6592  */
6593  __Pyx_TraceLine(649,0,__PYX_ERR(0, 649, __pyx_L1_error))
6594  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_A, __pyx_n_s_data); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 649, __pyx_L1_error)
6595  __Pyx_GOTREF(__pyx_t_2);
6596  __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 649, __pyx_L1_error)
6597  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6598  __pyx_v_A_data_long_double_mv = __pyx_t_8;
6599  __pyx_t_8.memview = NULL;
6600  __pyx_t_8.data = NULL;
6601 
6602  /* "imate/_c_linear_operator/py_c_matrix.pyx":652
6603  *
6604  * # Get pointers
6605  * A_data_long_double = &A_data_long_double_mv[0] # <<<<<<<<<<<<<<
6606  *
6607  * # Create a linear operator object
6608  */
6609  __Pyx_TraceLine(652,0,__PYX_ERR(0, 652, __pyx_L1_error))
6610  __pyx_t_7 = 0;
6611  __pyx_v_A_data_long_double = (&(*((long double *) ( /* dim=0 */ (__pyx_v_A_data_long_double_mv.data + __pyx_t_7 * __pyx_v_A_data_long_double_mv.strides[0]) ))));
6612 
6613  /* "imate/_c_linear_operator/py_c_matrix.pyx":655
6614  *
6615  * # Create a linear operator object
6616  * self.Aop_long_double = new cCSCMatrix[long double]( # <<<<<<<<<<<<<<
6617  * A_data_long_double,
6618  * A_indices,
6619  */
6620  __Pyx_TraceLine(655,0,__PYX_ERR(0, 655, __pyx_L1_error))
6621  try {
6622  __pyx_t_9 = new cCSCMatrix<long double> (__pyx_v_A_data_long_double, __pyx_v_A_indices, __pyx_v_A_index_pointer, __pyx_v_A_num_rows, __pyx_v_A_num_columns);
6623  } catch(...) {
6624  __Pyx_CppExn2PyErr();
6625  __PYX_ERR(0, 655, __pyx_L1_error)
6626  }
6627  __pyx_v_self->__pyx_base.Aop_long_double = __pyx_t_9;
6628 
6629  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
6630  * # ==========================
6631  *
6632  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
6633  * """
6634  * """
6635  */
6636 
6637  /* function exit code */
6638  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6639  goto __pyx_L0;
6640  __pyx_L1_error:;
6641  __Pyx_XDECREF(__pyx_t_1);
6642  __Pyx_XDECREF(__pyx_t_2);
6643  __Pyx_XDECREF(__pyx_t_4);
6644  __Pyx_XDECREF(__pyx_t_5);
6645  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
6646  __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
6647  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.set_csc_matrix_long_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
6648  __pyx_r = NULL;
6649  __pyx_L0:;
6650  __PYX_XDEC_MEMVIEW(&__pyx_v_A_data_long_double_mv, 1);
6651  __PYX_XDEC_MEMVIEW(&__pyx_v_A_indices_mv, 1);
6652  __PYX_XDEC_MEMVIEW(&__pyx_v_A_index_pointer_mv, 1);
6653  __Pyx_XGIVEREF(__pyx_r);
6654  __Pyx_TraceReturn(__pyx_r, 0);
6655  __Pyx_RefNannyFinishContext();
6656  return __pyx_r;
6657 }
6658 
6659 /* "(tree fragment)":1
6660  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6661  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6662  * def __setstate_cython__(self, __pyx_state):
6663  */
6664 
6665 /* Python wrapper */
6666 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
6667 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__[] = "pycMatrix.__reduce_cython__(self)";
6668 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__};
6669 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
6670  PyObject *__pyx_r = 0;
6671  __Pyx_RefNannyDeclarations
6672  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
6673  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self));
6674 
6675  /* function exit code */
6676  __Pyx_RefNannyFinishContext();
6677  return __pyx_r;
6678 }
6679 
6680 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self) {
6681  PyObject *__pyx_r = NULL;
6682  __Pyx_TraceDeclarations
6683  __Pyx_RefNannyDeclarations
6684  PyObject *__pyx_t_1 = NULL;
6685  int __pyx_lineno = 0;
6686  const char *__pyx_filename = NULL;
6687  int __pyx_clineno = 0;
6688  __Pyx_TraceFrameInit(__pyx_codeobj__14)
6689  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
6690  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
6691 
6692  /* "(tree fragment)":2
6693  * def __reduce_cython__(self):
6694  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6695  * def __setstate_cython__(self, __pyx_state):
6696  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6697  */
6698  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
6699  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
6700  __Pyx_GOTREF(__pyx_t_1);
6701  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6702  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6703  __PYX_ERR(1, 2, __pyx_L1_error)
6704 
6705  /* "(tree fragment)":1
6706  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
6707  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6708  * def __setstate_cython__(self, __pyx_state):
6709  */
6710 
6711  /* function exit code */
6712  __pyx_L1_error:;
6713  __Pyx_XDECREF(__pyx_t_1);
6714  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6715  __pyx_r = NULL;
6716  __Pyx_XGIVEREF(__pyx_r);
6717  __Pyx_TraceReturn(__pyx_r, 0);
6718  __Pyx_RefNannyFinishContext();
6719  return __pyx_r;
6720 }
6721 
6722 /* "(tree fragment)":3
6723  * def __reduce_cython__(self):
6724  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6725  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6726  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6727  */
6728 
6729 /* Python wrapper */
6730 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
6731 static char __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__[] = "pycMatrix.__setstate_cython__(self, __pyx_state)";
6732 static PyMethodDef __pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__};
6733 static PyObject *__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
6734  PyObject *__pyx_r = 0;
6735  __Pyx_RefNannyDeclarations
6736  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
6737  __pyx_r = __pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
6738 
6739  /* function exit code */
6740  __Pyx_RefNannyFinishContext();
6741  return __pyx_r;
6742 }
6743 
6744 static PyObject *__pyx_pf_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
6745  PyObject *__pyx_r = NULL;
6746  __Pyx_TraceDeclarations
6747  __Pyx_RefNannyDeclarations
6748  PyObject *__pyx_t_1 = NULL;
6749  int __pyx_lineno = 0;
6750  const char *__pyx_filename = NULL;
6751  int __pyx_clineno = 0;
6752  __Pyx_TraceFrameInit(__pyx_codeobj__16)
6753  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
6754  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
6755 
6756  /* "(tree fragment)":4
6757  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6758  * def __setstate_cython__(self, __pyx_state):
6759  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
6760  */
6761  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
6762  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
6763  __Pyx_GOTREF(__pyx_t_1);
6764  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
6765  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
6766  __PYX_ERR(1, 4, __pyx_L1_error)
6767 
6768  /* "(tree fragment)":3
6769  * def __reduce_cython__(self):
6770  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6771  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
6772  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
6773  */
6774 
6775  /* function exit code */
6776  __pyx_L1_error:;
6777  __Pyx_XDECREF(__pyx_t_1);
6778  __Pyx_AddTraceback("imate._c_linear_operator.py_c_matrix.pycMatrix.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6779  __pyx_r = NULL;
6780  __Pyx_XGIVEREF(__pyx_r);
6781  __Pyx_TraceReturn(__pyx_r, 0);
6782  __Pyx_RefNannyFinishContext();
6783  return __pyx_r;
6784 }
6785 
6786 /* "View.MemoryView":122
6787  * cdef bint dtype_is_object
6788  *
6789  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6790  * mode="c", bint allocate_buffer=True):
6791  *
6792  */
6793 
6794 /* Python wrapper */
6795 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6796 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6797  PyObject *__pyx_v_shape = 0;
6798  Py_ssize_t __pyx_v_itemsize;
6799  PyObject *__pyx_v_format = 0;
6800  PyObject *__pyx_v_mode = 0;
6801  int __pyx_v_allocate_buffer;
6802  int __pyx_lineno = 0;
6803  const char *__pyx_filename = NULL;
6804  int __pyx_clineno = 0;
6805  int __pyx_r;
6806  __Pyx_RefNannyDeclarations
6807  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
6808  {
6809  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
6810  PyObject* values[5] = {0,0,0,0,0};
6811  values[3] = ((PyObject *)__pyx_n_s_c);
6812  if (unlikely(__pyx_kwds)) {
6813  Py_ssize_t kw_args;
6814  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6815  switch (pos_args) {
6816  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6817  CYTHON_FALLTHROUGH;
6818  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6819  CYTHON_FALLTHROUGH;
6820  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6821  CYTHON_FALLTHROUGH;
6822  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6823  CYTHON_FALLTHROUGH;
6824  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6825  CYTHON_FALLTHROUGH;
6826  case 0: break;
6827  default: goto __pyx_L5_argtuple_error;
6828  }
6829  kw_args = PyDict_Size(__pyx_kwds);
6830  switch (pos_args) {
6831  case 0:
6832  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
6833  else goto __pyx_L5_argtuple_error;
6834  CYTHON_FALLTHROUGH;
6835  case 1:
6836  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
6837  else {
6838  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(1, 122, __pyx_L3_error)
6839  }
6840  CYTHON_FALLTHROUGH;
6841  case 2:
6842  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
6843  else {
6844  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(1, 122, __pyx_L3_error)
6845  }
6846  CYTHON_FALLTHROUGH;
6847  case 3:
6848  if (kw_args > 0) {
6849  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
6850  if (value) { values[3] = value; kw_args--; }
6851  }
6852  CYTHON_FALLTHROUGH;
6853  case 4:
6854  if (kw_args > 0) {
6855  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
6856  if (value) { values[4] = value; kw_args--; }
6857  }
6858  }
6859  if (unlikely(kw_args > 0)) {
6860  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 122, __pyx_L3_error)
6861  }
6862  } else {
6863  switch (PyTuple_GET_SIZE(__pyx_args)) {
6864  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6865  CYTHON_FALLTHROUGH;
6866  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6867  CYTHON_FALLTHROUGH;
6868  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6869  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6870  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6871  break;
6872  default: goto __pyx_L5_argtuple_error;
6873  }
6874  }
6875  __pyx_v_shape = ((PyObject*)values[0]);
6876  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 122, __pyx_L3_error)
6877  __pyx_v_format = values[2];
6878  __pyx_v_mode = values[3];
6879  if (values[4]) {
6880  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L3_error)
6881  } else {
6882 
6883  /* "View.MemoryView":123
6884  *
6885  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
6886  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
6887  *
6888  * cdef int idx
6889  */
6890  __pyx_v_allocate_buffer = ((int)1);
6891  }
6892  }
6893  goto __pyx_L4_argument_unpacking_done;
6894  __pyx_L5_argtuple_error:;
6895  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 122, __pyx_L3_error)
6896  __pyx_L3_error:;
6897  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6898  __Pyx_RefNannyFinishContext();
6899  return -1;
6900  __pyx_L4_argument_unpacking_done:;
6901  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(1, 122, __pyx_L1_error)
6902  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
6903  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(1, 122, __pyx_L1_error)
6904  }
6905  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
6906 
6907  /* "View.MemoryView":122
6908  * cdef bint dtype_is_object
6909  *
6910  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
6911  * mode="c", bint allocate_buffer=True):
6912  *
6913  */
6914 
6915  /* function exit code */
6916  goto __pyx_L0;
6917  __pyx_L1_error:;
6918  __pyx_r = -1;
6919  __pyx_L0:;
6920  __Pyx_RefNannyFinishContext();
6921  return __pyx_r;
6922 }
6923 
6924 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
6925  int __pyx_v_idx;
6926  Py_ssize_t __pyx_v_i;
6927  Py_ssize_t __pyx_v_dim;
6928  PyObject **__pyx_v_p;
6929  char __pyx_v_order;
6930  int __pyx_r;
6931  __Pyx_TraceDeclarations
6932  __Pyx_RefNannyDeclarations
6933  Py_ssize_t __pyx_t_1;
6934  int __pyx_t_2;
6935  PyObject *__pyx_t_3 = NULL;
6936  int __pyx_t_4;
6937  PyObject *__pyx_t_5 = NULL;
6938  PyObject *__pyx_t_6 = NULL;
6939  char *__pyx_t_7;
6940  int __pyx_t_8;
6941  Py_ssize_t __pyx_t_9;
6942  PyObject *__pyx_t_10 = NULL;
6943  Py_ssize_t __pyx_t_11;
6944  int __pyx_lineno = 0;
6945  const char *__pyx_filename = NULL;
6946  int __pyx_clineno = 0;
6947  __Pyx_RefNannySetupContext("__cinit__", 0);
6948  __Pyx_TraceCall("__cinit__", __pyx_f[1], 122, 0, __PYX_ERR(1, 122, __pyx_L1_error));
6949  __Pyx_INCREF(__pyx_v_format);
6950 
6951  /* "View.MemoryView":129
6952  * cdef PyObject **p
6953  *
6954  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
6955  * self.itemsize = itemsize
6956  *
6957  */
6958  __Pyx_TraceLine(129,0,__PYX_ERR(1, 129, __pyx_L1_error))
6959  if (unlikely(__pyx_v_shape == Py_None)) {
6960  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
6961  __PYX_ERR(1, 129, __pyx_L1_error)
6962  }
6963  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(1, 129, __pyx_L1_error)
6964  __pyx_v_self->ndim = ((int)__pyx_t_1);
6965 
6966  /* "View.MemoryView":130
6967  *
6968  * self.ndim = <int> len(shape)
6969  * self.itemsize = itemsize # <<<<<<<<<<<<<<
6970  *
6971  * if not self.ndim:
6972  */
6973  __Pyx_TraceLine(130,0,__PYX_ERR(1, 130, __pyx_L1_error))
6974  __pyx_v_self->itemsize = __pyx_v_itemsize;
6975 
6976  /* "View.MemoryView":132
6977  * self.itemsize = itemsize
6978  *
6979  * if not self.ndim: # <<<<<<<<<<<<<<
6980  * raise ValueError("Empty shape tuple for cython.array")
6981  *
6982  */
6983  __Pyx_TraceLine(132,0,__PYX_ERR(1, 132, __pyx_L1_error))
6984  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
6985  if (unlikely(__pyx_t_2)) {
6986 
6987  /* "View.MemoryView":133
6988  *
6989  * if not self.ndim:
6990  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
6991  *
6992  * if itemsize <= 0:
6993  */
6994  __Pyx_TraceLine(133,0,__PYX_ERR(1, 133, __pyx_L1_error))
6995  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 133, __pyx_L1_error)
6996  __Pyx_GOTREF(__pyx_t_3);
6997  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6998  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6999  __PYX_ERR(1, 133, __pyx_L1_error)
7000 
7001  /* "View.MemoryView":132
7002  * self.itemsize = itemsize
7003  *
7004  * if not self.ndim: # <<<<<<<<<<<<<<
7005  * raise ValueError("Empty shape tuple for cython.array")
7006  *
7007  */
7008  }
7009 
7010  /* "View.MemoryView":135
7011  * raise ValueError("Empty shape tuple for cython.array")
7012  *
7013  * if itemsize <= 0: # <<<<<<<<<<<<<<
7014  * raise ValueError("itemsize <= 0 for cython.array")
7015  *
7016  */
7017  __Pyx_TraceLine(135,0,__PYX_ERR(1, 135, __pyx_L1_error))
7018  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
7019  if (unlikely(__pyx_t_2)) {
7020 
7021  /* "View.MemoryView":136
7022  *
7023  * if itemsize <= 0:
7024  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
7025  *
7026  * if not isinstance(format, bytes):
7027  */
7028  __Pyx_TraceLine(136,0,__PYX_ERR(1, 136, __pyx_L1_error))
7029  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 136, __pyx_L1_error)
7030  __Pyx_GOTREF(__pyx_t_3);
7031  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7032  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7033  __PYX_ERR(1, 136, __pyx_L1_error)
7034 
7035  /* "View.MemoryView":135
7036  * raise ValueError("Empty shape tuple for cython.array")
7037  *
7038  * if itemsize <= 0: # <<<<<<<<<<<<<<
7039  * raise ValueError("itemsize <= 0 for cython.array")
7040  *
7041  */
7042  }
7043 
7044  /* "View.MemoryView":138
7045  * raise ValueError("itemsize <= 0 for cython.array")
7046  *
7047  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7048  * format = format.encode('ASCII')
7049  * self._format = format # keep a reference to the byte string
7050  */
7051  __Pyx_TraceLine(138,0,__PYX_ERR(1, 138, __pyx_L1_error))
7052  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
7053  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
7054  if (__pyx_t_4) {
7055 
7056  /* "View.MemoryView":139
7057  *
7058  * if not isinstance(format, bytes):
7059  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
7060  * self._format = format # keep a reference to the byte string
7061  * self.format = self._format
7062  */
7063  __Pyx_TraceLine(139,0,__PYX_ERR(1, 139, __pyx_L1_error))
7064  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
7065  __Pyx_GOTREF(__pyx_t_5);
7066  __pyx_t_6 = NULL;
7067  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
7068  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
7069  if (likely(__pyx_t_6)) {
7070  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
7071  __Pyx_INCREF(__pyx_t_6);
7072  __Pyx_INCREF(function);
7073  __Pyx_DECREF_SET(__pyx_t_5, function);
7074  }
7075  }
7076  __pyx_t_3 = (__pyx_t_6) ? __Pyx_PyObject_Call2Args(__pyx_t_5, __pyx_t_6, __pyx_n_s_ASCII) : __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_n_s_ASCII);
7077  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7078  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 139, __pyx_L1_error)
7079  __Pyx_GOTREF(__pyx_t_3);
7080  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7081  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_3);
7082  __pyx_t_3 = 0;
7083 
7084  /* "View.MemoryView":138
7085  * raise ValueError("itemsize <= 0 for cython.array")
7086  *
7087  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
7088  * format = format.encode('ASCII')
7089  * self._format = format # keep a reference to the byte string
7090  */
7091  }
7092 
7093  /* "View.MemoryView":140
7094  * if not isinstance(format, bytes):
7095  * format = format.encode('ASCII')
7096  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
7097  * self.format = self._format
7098  *
7099  */
7100  __Pyx_TraceLine(140,0,__PYX_ERR(1, 140, __pyx_L1_error))
7101  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(1, 140, __pyx_L1_error)
7102  __pyx_t_3 = __pyx_v_format;
7103  __Pyx_INCREF(__pyx_t_3);
7104  __Pyx_GIVEREF(__pyx_t_3);
7105  __Pyx_GOTREF(__pyx_v_self->_format);
7106  __Pyx_DECREF(__pyx_v_self->_format);
7107  __pyx_v_self->_format = ((PyObject*)__pyx_t_3);
7108  __pyx_t_3 = 0;
7109 
7110  /* "View.MemoryView":141
7111  * format = format.encode('ASCII')
7112  * self._format = format # keep a reference to the byte string
7113  * self.format = self._format # <<<<<<<<<<<<<<
7114  *
7115  *
7116  */
7117  __Pyx_TraceLine(141,0,__PYX_ERR(1, 141, __pyx_L1_error))
7118  if (unlikely(__pyx_v_self->_format == Py_None)) {
7119  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
7120  __PYX_ERR(1, 141, __pyx_L1_error)
7121  }
7122  __pyx_t_7 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
7123  __pyx_v_self->format = __pyx_t_7;
7124 
7125  /* "View.MemoryView":144
7126  *
7127  *
7128  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
7129  * self._strides = self._shape + self.ndim
7130  *
7131  */
7132  __Pyx_TraceLine(144,0,__PYX_ERR(1, 144, __pyx_L1_error))
7133  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
7134 
7135  /* "View.MemoryView":145
7136  *
7137  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
7138  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
7139  *
7140  * if not self._shape:
7141  */
7142  __Pyx_TraceLine(145,0,__PYX_ERR(1, 145, __pyx_L1_error))
7143  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
7144 
7145  /* "View.MemoryView":147
7146  * self._strides = self._shape + self.ndim
7147  *
7148  * if not self._shape: # <<<<<<<<<<<<<<
7149  * raise MemoryError("unable to allocate shape and strides.")
7150  *
7151  */
7152  __Pyx_TraceLine(147,0,__PYX_ERR(1, 147, __pyx_L1_error))
7153  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
7154  if (unlikely(__pyx_t_4)) {
7155 
7156  /* "View.MemoryView":148
7157  *
7158  * if not self._shape:
7159  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
7160  *
7161  *
7162  */
7163  __Pyx_TraceLine(148,0,__PYX_ERR(1, 148, __pyx_L1_error))
7164  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 148, __pyx_L1_error)
7165  __Pyx_GOTREF(__pyx_t_3);
7166  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7167  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7168  __PYX_ERR(1, 148, __pyx_L1_error)
7169 
7170  /* "View.MemoryView":147
7171  * self._strides = self._shape + self.ndim
7172  *
7173  * if not self._shape: # <<<<<<<<<<<<<<
7174  * raise MemoryError("unable to allocate shape and strides.")
7175  *
7176  */
7177  }
7178 
7179  /* "View.MemoryView":151
7180  *
7181  *
7182  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7183  * if dim <= 0:
7184  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7185  */
7186  __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
7187  __pyx_t_8 = 0;
7188  __pyx_t_3 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
7189  for (;;) {
7190  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
7191  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7192  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(1, 151, __pyx_L1_error)
7193  #else
7194  __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 151, __pyx_L1_error)
7195  __Pyx_GOTREF(__pyx_t_5);
7196  #endif
7197  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
7198  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7199  __pyx_v_dim = __pyx_t_9;
7200  __pyx_v_idx = __pyx_t_8;
7201  __pyx_t_8 = (__pyx_t_8 + 1);
7202 
7203  /* "View.MemoryView":152
7204  *
7205  * for idx, dim in enumerate(shape):
7206  * if dim <= 0: # <<<<<<<<<<<<<<
7207  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7208  * self._shape[idx] = dim
7209  */
7210  __Pyx_TraceLine(152,0,__PYX_ERR(1, 152, __pyx_L1_error))
7211  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
7212  if (unlikely(__pyx_t_4)) {
7213 
7214  /* "View.MemoryView":153
7215  * for idx, dim in enumerate(shape):
7216  * if dim <= 0:
7217  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
7218  * self._shape[idx] = dim
7219  *
7220  */
7221  __Pyx_TraceLine(153,0,__PYX_ERR(1, 153, __pyx_L1_error))
7222  __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 153, __pyx_L1_error)
7223  __Pyx_GOTREF(__pyx_t_5);
7224  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7225  __Pyx_GOTREF(__pyx_t_6);
7226  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7227  __Pyx_GOTREF(__pyx_t_10);
7228  __Pyx_GIVEREF(__pyx_t_5);
7229  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_5);
7230  __Pyx_GIVEREF(__pyx_t_6);
7231  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_6);
7232  __pyx_t_5 = 0;
7233  __pyx_t_6 = 0;
7234  __pyx_t_6 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 153, __pyx_L1_error)
7235  __Pyx_GOTREF(__pyx_t_6);
7236  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7237  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 153, __pyx_L1_error)
7238  __Pyx_GOTREF(__pyx_t_10);
7239  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7240  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7241  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7242  __PYX_ERR(1, 153, __pyx_L1_error)
7243 
7244  /* "View.MemoryView":152
7245  *
7246  * for idx, dim in enumerate(shape):
7247  * if dim <= 0: # <<<<<<<<<<<<<<
7248  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7249  * self._shape[idx] = dim
7250  */
7251  }
7252 
7253  /* "View.MemoryView":154
7254  * if dim <= 0:
7255  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7256  * self._shape[idx] = dim # <<<<<<<<<<<<<<
7257  *
7258  * cdef char order
7259  */
7260  __Pyx_TraceLine(154,0,__PYX_ERR(1, 154, __pyx_L1_error))
7261  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
7262 
7263  /* "View.MemoryView":151
7264  *
7265  *
7266  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
7267  * if dim <= 0:
7268  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
7269  */
7270  __Pyx_TraceLine(151,0,__PYX_ERR(1, 151, __pyx_L1_error))
7271  }
7272  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7273 
7274  /* "View.MemoryView":157
7275  *
7276  * cdef char order
7277  * if mode == 'fortran': # <<<<<<<<<<<<<<
7278  * order = b'F'
7279  * self.mode = u'fortran'
7280  */
7281  __Pyx_TraceLine(157,0,__PYX_ERR(1, 157, __pyx_L1_error))
7282  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 157, __pyx_L1_error)
7283  if (__pyx_t_4) {
7284 
7285  /* "View.MemoryView":158
7286  * cdef char order
7287  * if mode == 'fortran':
7288  * order = b'F' # <<<<<<<<<<<<<<
7289  * self.mode = u'fortran'
7290  * elif mode == 'c':
7291  */
7292  __Pyx_TraceLine(158,0,__PYX_ERR(1, 158, __pyx_L1_error))
7293  __pyx_v_order = 'F';
7294 
7295  /* "View.MemoryView":159
7296  * if mode == 'fortran':
7297  * order = b'F'
7298  * self.mode = u'fortran' # <<<<<<<<<<<<<<
7299  * elif mode == 'c':
7300  * order = b'C'
7301  */
7302  __Pyx_TraceLine(159,0,__PYX_ERR(1, 159, __pyx_L1_error))
7303  __Pyx_INCREF(__pyx_n_u_fortran);
7304  __Pyx_GIVEREF(__pyx_n_u_fortran);
7305  __Pyx_GOTREF(__pyx_v_self->mode);
7306  __Pyx_DECREF(__pyx_v_self->mode);
7307  __pyx_v_self->mode = __pyx_n_u_fortran;
7308 
7309  /* "View.MemoryView":157
7310  *
7311  * cdef char order
7312  * if mode == 'fortran': # <<<<<<<<<<<<<<
7313  * order = b'F'
7314  * self.mode = u'fortran'
7315  */
7316  goto __pyx_L10;
7317  }
7318 
7319  /* "View.MemoryView":160
7320  * order = b'F'
7321  * self.mode = u'fortran'
7322  * elif mode == 'c': # <<<<<<<<<<<<<<
7323  * order = b'C'
7324  * self.mode = u'c'
7325  */
7326  __Pyx_TraceLine(160,0,__PYX_ERR(1, 160, __pyx_L1_error))
7327  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(1, 160, __pyx_L1_error)
7328  if (likely(__pyx_t_4)) {
7329 
7330  /* "View.MemoryView":161
7331  * self.mode = u'fortran'
7332  * elif mode == 'c':
7333  * order = b'C' # <<<<<<<<<<<<<<
7334  * self.mode = u'c'
7335  * else:
7336  */
7337  __Pyx_TraceLine(161,0,__PYX_ERR(1, 161, __pyx_L1_error))
7338  __pyx_v_order = 'C';
7339 
7340  /* "View.MemoryView":162
7341  * elif mode == 'c':
7342  * order = b'C'
7343  * self.mode = u'c' # <<<<<<<<<<<<<<
7344  * else:
7345  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7346  */
7347  __Pyx_TraceLine(162,0,__PYX_ERR(1, 162, __pyx_L1_error))
7348  __Pyx_INCREF(__pyx_n_u_c);
7349  __Pyx_GIVEREF(__pyx_n_u_c);
7350  __Pyx_GOTREF(__pyx_v_self->mode);
7351  __Pyx_DECREF(__pyx_v_self->mode);
7352  __pyx_v_self->mode = __pyx_n_u_c;
7353 
7354  /* "View.MemoryView":160
7355  * order = b'F'
7356  * self.mode = u'fortran'
7357  * elif mode == 'c': # <<<<<<<<<<<<<<
7358  * order = b'C'
7359  * self.mode = u'c'
7360  */
7361  goto __pyx_L10;
7362  }
7363 
7364  /* "View.MemoryView":164
7365  * self.mode = u'c'
7366  * else:
7367  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
7368  *
7369  * self.len = fill_contig_strides_array(self._shape, self._strides,
7370  */
7371  __Pyx_TraceLine(164,0,__PYX_ERR(1, 164, __pyx_L1_error))
7372  /*else*/ {
7373  __pyx_t_3 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 164, __pyx_L1_error)
7374  __Pyx_GOTREF(__pyx_t_3);
7375  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 164, __pyx_L1_error)
7376  __Pyx_GOTREF(__pyx_t_10);
7377  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7378  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7379  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7380  __PYX_ERR(1, 164, __pyx_L1_error)
7381  }
7382  __pyx_L10:;
7383 
7384  /* "View.MemoryView":166
7385  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
7386  *
7387  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
7388  * itemsize, self.ndim, order)
7389  *
7390  */
7391  __Pyx_TraceLine(166,0,__PYX_ERR(1, 166, __pyx_L1_error))
7392  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
7393 
7394  /* "View.MemoryView":169
7395  * itemsize, self.ndim, order)
7396  *
7397  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
7398  * self.dtype_is_object = format == b'O'
7399  * if allocate_buffer:
7400  */
7401  __Pyx_TraceLine(169,0,__PYX_ERR(1, 169, __pyx_L1_error))
7402  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
7403 
7404  /* "View.MemoryView":170
7405  *
7406  * self.free_data = allocate_buffer
7407  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
7408  * if allocate_buffer:
7409  *
7410  */
7411  __Pyx_TraceLine(170,0,__PYX_ERR(1, 170, __pyx_L1_error))
7412  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 170, __pyx_L1_error)
7413  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 170, __pyx_L1_error)
7414  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7415  __pyx_v_self->dtype_is_object = __pyx_t_4;
7416 
7417  /* "View.MemoryView":171
7418  * self.free_data = allocate_buffer
7419  * self.dtype_is_object = format == b'O'
7420  * if allocate_buffer: # <<<<<<<<<<<<<<
7421  *
7422  *
7423  */
7424  __Pyx_TraceLine(171,0,__PYX_ERR(1, 171, __pyx_L1_error))
7425  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
7426  if (__pyx_t_4) {
7427 
7428  /* "View.MemoryView":174
7429  *
7430  *
7431  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
7432  * if not self.data:
7433  * raise MemoryError("unable to allocate array data.")
7434  */
7435  __Pyx_TraceLine(174,0,__PYX_ERR(1, 174, __pyx_L1_error))
7436  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
7437 
7438  /* "View.MemoryView":175
7439  *
7440  * self.data = <char *>malloc(self.len)
7441  * if not self.data: # <<<<<<<<<<<<<<
7442  * raise MemoryError("unable to allocate array data.")
7443  *
7444  */
7445  __Pyx_TraceLine(175,0,__PYX_ERR(1, 175, __pyx_L1_error))
7446  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
7447  if (unlikely(__pyx_t_4)) {
7448 
7449  /* "View.MemoryView":176
7450  * self.data = <char *>malloc(self.len)
7451  * if not self.data:
7452  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
7453  *
7454  * if self.dtype_is_object:
7455  */
7456  __Pyx_TraceLine(176,0,__PYX_ERR(1, 176, __pyx_L1_error))
7457  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 176, __pyx_L1_error)
7458  __Pyx_GOTREF(__pyx_t_10);
7459  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
7460  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
7461  __PYX_ERR(1, 176, __pyx_L1_error)
7462 
7463  /* "View.MemoryView":175
7464  *
7465  * self.data = <char *>malloc(self.len)
7466  * if not self.data: # <<<<<<<<<<<<<<
7467  * raise MemoryError("unable to allocate array data.")
7468  *
7469  */
7470  }
7471 
7472  /* "View.MemoryView":178
7473  * raise MemoryError("unable to allocate array data.")
7474  *
7475  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7476  * p = <PyObject **> self.data
7477  * for i in range(self.len / itemsize):
7478  */
7479  __Pyx_TraceLine(178,0,__PYX_ERR(1, 178, __pyx_L1_error))
7480  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
7481  if (__pyx_t_4) {
7482 
7483  /* "View.MemoryView":179
7484  *
7485  * if self.dtype_is_object:
7486  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
7487  * for i in range(self.len / itemsize):
7488  * p[i] = Py_None
7489  */
7490  __Pyx_TraceLine(179,0,__PYX_ERR(1, 179, __pyx_L1_error))
7491  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
7492 
7493  /* "View.MemoryView":180
7494  * if self.dtype_is_object:
7495  * p = <PyObject **> self.data
7496  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
7497  * p[i] = Py_None
7498  * Py_INCREF(Py_None)
7499  */
7500  __Pyx_TraceLine(180,0,__PYX_ERR(1, 180, __pyx_L1_error))
7501  if (unlikely(__pyx_v_itemsize == 0)) {
7502  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
7503  __PYX_ERR(1, 180, __pyx_L1_error)
7504  }
7505  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
7506  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
7507  __PYX_ERR(1, 180, __pyx_L1_error)
7508  }
7509  __pyx_t_1 = (__pyx_v_self->len / __pyx_v_itemsize);
7510  __pyx_t_9 = __pyx_t_1;
7511  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_9; __pyx_t_11+=1) {
7512  __pyx_v_i = __pyx_t_11;
7513 
7514  /* "View.MemoryView":181
7515  * p = <PyObject **> self.data
7516  * for i in range(self.len / itemsize):
7517  * p[i] = Py_None # <<<<<<<<<<<<<<
7518  * Py_INCREF(Py_None)
7519  *
7520  */
7521  __Pyx_TraceLine(181,0,__PYX_ERR(1, 181, __pyx_L1_error))
7522  (__pyx_v_p[__pyx_v_i]) = Py_None;
7523 
7524  /* "View.MemoryView":182
7525  * for i in range(self.len / itemsize):
7526  * p[i] = Py_None
7527  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
7528  *
7529  * @cname('getbuffer')
7530  */
7531  __Pyx_TraceLine(182,0,__PYX_ERR(1, 182, __pyx_L1_error))
7532  Py_INCREF(Py_None);
7533  }
7534 
7535  /* "View.MemoryView":178
7536  * raise MemoryError("unable to allocate array data.")
7537  *
7538  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7539  * p = <PyObject **> self.data
7540  * for i in range(self.len / itemsize):
7541  */
7542  }
7543 
7544  /* "View.MemoryView":171
7545  * self.free_data = allocate_buffer
7546  * self.dtype_is_object = format == b'O'
7547  * if allocate_buffer: # <<<<<<<<<<<<<<
7548  *
7549  *
7550  */
7551  }
7552 
7553  /* "View.MemoryView":122
7554  * cdef bint dtype_is_object
7555  *
7556  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7557  * mode="c", bint allocate_buffer=True):
7558  *
7559  */
7560 
7561  /* function exit code */
7562  __pyx_r = 0;
7563  goto __pyx_L0;
7564  __pyx_L1_error:;
7565  __Pyx_XDECREF(__pyx_t_3);
7566  __Pyx_XDECREF(__pyx_t_5);
7567  __Pyx_XDECREF(__pyx_t_6);
7568  __Pyx_XDECREF(__pyx_t_10);
7569  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7570  __pyx_r = -1;
7571  __pyx_L0:;
7572  __Pyx_XDECREF(__pyx_v_format);
7573  __Pyx_TraceReturn(Py_None, 0);
7574  __Pyx_RefNannyFinishContext();
7575  return __pyx_r;
7576 }
7577 
7578 /* "View.MemoryView":185
7579  *
7580  * @cname('getbuffer')
7581  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7582  * cdef int bufmode = -1
7583  * if self.mode == u"c":
7584  */
7585 
7586 /* Python wrapper */
7587 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
7588 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7589  int __pyx_r;
7590  __Pyx_RefNannyDeclarations
7591  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
7592  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
7593 
7594  /* function exit code */
7595  __Pyx_RefNannyFinishContext();
7596  return __pyx_r;
7597 }
7598 
7599 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
7600  int __pyx_v_bufmode;
7601  int __pyx_r;
7602  __Pyx_TraceDeclarations
7603  __Pyx_RefNannyDeclarations
7604  int __pyx_t_1;
7605  int __pyx_t_2;
7606  PyObject *__pyx_t_3 = NULL;
7607  char *__pyx_t_4;
7608  Py_ssize_t __pyx_t_5;
7609  int __pyx_t_6;
7610  Py_ssize_t *__pyx_t_7;
7611  int __pyx_lineno = 0;
7612  const char *__pyx_filename = NULL;
7613  int __pyx_clineno = 0;
7614  if (__pyx_v_info == NULL) {
7615  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
7616  return -1;
7617  }
7618  __Pyx_RefNannySetupContext("__getbuffer__", 0);
7619  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
7620  __Pyx_GIVEREF(__pyx_v_info->obj);
7621  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 185, 0, __PYX_ERR(1, 185, __pyx_L1_error));
7622 
7623  /* "View.MemoryView":186
7624  * @cname('getbuffer')
7625  * def __getbuffer__(self, Py_buffer *info, int flags):
7626  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
7627  * if self.mode == u"c":
7628  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7629  */
7630  __Pyx_TraceLine(186,0,__PYX_ERR(1, 186, __pyx_L1_error))
7631  __pyx_v_bufmode = -1;
7632 
7633  /* "View.MemoryView":187
7634  * def __getbuffer__(self, Py_buffer *info, int flags):
7635  * cdef int bufmode = -1
7636  * if self.mode == u"c": # <<<<<<<<<<<<<<
7637  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7638  * elif self.mode == u"fortran":
7639  */
7640  __Pyx_TraceLine(187,0,__PYX_ERR(1, 187, __pyx_L1_error))
7641  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 187, __pyx_L1_error)
7642  __pyx_t_2 = (__pyx_t_1 != 0);
7643  if (__pyx_t_2) {
7644 
7645  /* "View.MemoryView":188
7646  * cdef int bufmode = -1
7647  * if self.mode == u"c":
7648  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7649  * elif self.mode == u"fortran":
7650  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7651  */
7652  __Pyx_TraceLine(188,0,__PYX_ERR(1, 188, __pyx_L1_error))
7653  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7654 
7655  /* "View.MemoryView":187
7656  * def __getbuffer__(self, Py_buffer *info, int flags):
7657  * cdef int bufmode = -1
7658  * if self.mode == u"c": # <<<<<<<<<<<<<<
7659  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7660  * elif self.mode == u"fortran":
7661  */
7662  goto __pyx_L3;
7663  }
7664 
7665  /* "View.MemoryView":189
7666  * if self.mode == u"c":
7667  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7668  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7669  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7670  * if not (flags & bufmode):
7671  */
7672  __Pyx_TraceLine(189,0,__PYX_ERR(1, 189, __pyx_L1_error))
7673  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 189, __pyx_L1_error)
7674  __pyx_t_1 = (__pyx_t_2 != 0);
7675  if (__pyx_t_1) {
7676 
7677  /* "View.MemoryView":190
7678  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7679  * elif self.mode == u"fortran":
7680  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
7681  * if not (flags & bufmode):
7682  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7683  */
7684  __Pyx_TraceLine(190,0,__PYX_ERR(1, 190, __pyx_L1_error))
7685  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
7686 
7687  /* "View.MemoryView":189
7688  * if self.mode == u"c":
7689  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7690  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
7691  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7692  * if not (flags & bufmode):
7693  */
7694  }
7695  __pyx_L3:;
7696 
7697  /* "View.MemoryView":191
7698  * elif self.mode == u"fortran":
7699  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7700  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7701  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7702  * info.buf = self.data
7703  */
7704  __Pyx_TraceLine(191,0,__PYX_ERR(1, 191, __pyx_L1_error))
7705  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
7706  if (unlikely(__pyx_t_1)) {
7707 
7708  /* "View.MemoryView":192
7709  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7710  * if not (flags & bufmode):
7711  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
7712  * info.buf = self.data
7713  * info.len = self.len
7714  */
7715  __Pyx_TraceLine(192,0,__PYX_ERR(1, 192, __pyx_L1_error))
7716  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 192, __pyx_L1_error)
7717  __Pyx_GOTREF(__pyx_t_3);
7718  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
7719  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7720  __PYX_ERR(1, 192, __pyx_L1_error)
7721 
7722  /* "View.MemoryView":191
7723  * elif self.mode == u"fortran":
7724  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
7725  * if not (flags & bufmode): # <<<<<<<<<<<<<<
7726  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7727  * info.buf = self.data
7728  */
7729  }
7730 
7731  /* "View.MemoryView":193
7732  * if not (flags & bufmode):
7733  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7734  * info.buf = self.data # <<<<<<<<<<<<<<
7735  * info.len = self.len
7736  * info.ndim = self.ndim
7737  */
7738  __Pyx_TraceLine(193,0,__PYX_ERR(1, 193, __pyx_L1_error))
7739  __pyx_t_4 = __pyx_v_self->data;
7740  __pyx_v_info->buf = __pyx_t_4;
7741 
7742  /* "View.MemoryView":194
7743  * raise ValueError("Can only create a buffer that is contiguous in memory.")
7744  * info.buf = self.data
7745  * info.len = self.len # <<<<<<<<<<<<<<
7746  * info.ndim = self.ndim
7747  * info.shape = self._shape
7748  */
7749  __Pyx_TraceLine(194,0,__PYX_ERR(1, 194, __pyx_L1_error))
7750  __pyx_t_5 = __pyx_v_self->len;
7751  __pyx_v_info->len = __pyx_t_5;
7752 
7753  /* "View.MemoryView":195
7754  * info.buf = self.data
7755  * info.len = self.len
7756  * info.ndim = self.ndim # <<<<<<<<<<<<<<
7757  * info.shape = self._shape
7758  * info.strides = self._strides
7759  */
7760  __Pyx_TraceLine(195,0,__PYX_ERR(1, 195, __pyx_L1_error))
7761  __pyx_t_6 = __pyx_v_self->ndim;
7762  __pyx_v_info->ndim = __pyx_t_6;
7763 
7764  /* "View.MemoryView":196
7765  * info.len = self.len
7766  * info.ndim = self.ndim
7767  * info.shape = self._shape # <<<<<<<<<<<<<<
7768  * info.strides = self._strides
7769  * info.suboffsets = NULL
7770  */
7771  __Pyx_TraceLine(196,0,__PYX_ERR(1, 196, __pyx_L1_error))
7772  __pyx_t_7 = __pyx_v_self->_shape;
7773  __pyx_v_info->shape = __pyx_t_7;
7774 
7775  /* "View.MemoryView":197
7776  * info.ndim = self.ndim
7777  * info.shape = self._shape
7778  * info.strides = self._strides # <<<<<<<<<<<<<<
7779  * info.suboffsets = NULL
7780  * info.itemsize = self.itemsize
7781  */
7782  __Pyx_TraceLine(197,0,__PYX_ERR(1, 197, __pyx_L1_error))
7783  __pyx_t_7 = __pyx_v_self->_strides;
7784  __pyx_v_info->strides = __pyx_t_7;
7785 
7786  /* "View.MemoryView":198
7787  * info.shape = self._shape
7788  * info.strides = self._strides
7789  * info.suboffsets = NULL # <<<<<<<<<<<<<<
7790  * info.itemsize = self.itemsize
7791  * info.readonly = 0
7792  */
7793  __Pyx_TraceLine(198,0,__PYX_ERR(1, 198, __pyx_L1_error))
7794  __pyx_v_info->suboffsets = NULL;
7795 
7796  /* "View.MemoryView":199
7797  * info.strides = self._strides
7798  * info.suboffsets = NULL
7799  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
7800  * info.readonly = 0
7801  *
7802  */
7803  __Pyx_TraceLine(199,0,__PYX_ERR(1, 199, __pyx_L1_error))
7804  __pyx_t_5 = __pyx_v_self->itemsize;
7805  __pyx_v_info->itemsize = __pyx_t_5;
7806 
7807  /* "View.MemoryView":200
7808  * info.suboffsets = NULL
7809  * info.itemsize = self.itemsize
7810  * info.readonly = 0 # <<<<<<<<<<<<<<
7811  *
7812  * if flags & PyBUF_FORMAT:
7813  */
7814  __Pyx_TraceLine(200,0,__PYX_ERR(1, 200, __pyx_L1_error))
7815  __pyx_v_info->readonly = 0;
7816 
7817  /* "View.MemoryView":202
7818  * info.readonly = 0
7819  *
7820  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7821  * info.format = self.format
7822  * else:
7823  */
7824  __Pyx_TraceLine(202,0,__PYX_ERR(1, 202, __pyx_L1_error))
7825  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
7826  if (__pyx_t_1) {
7827 
7828  /* "View.MemoryView":203
7829  *
7830  * if flags & PyBUF_FORMAT:
7831  * info.format = self.format # <<<<<<<<<<<<<<
7832  * else:
7833  * info.format = NULL
7834  */
7835  __Pyx_TraceLine(203,0,__PYX_ERR(1, 203, __pyx_L1_error))
7836  __pyx_t_4 = __pyx_v_self->format;
7837  __pyx_v_info->format = __pyx_t_4;
7838 
7839  /* "View.MemoryView":202
7840  * info.readonly = 0
7841  *
7842  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
7843  * info.format = self.format
7844  * else:
7845  */
7846  goto __pyx_L5;
7847  }
7848 
7849  /* "View.MemoryView":205
7850  * info.format = self.format
7851  * else:
7852  * info.format = NULL # <<<<<<<<<<<<<<
7853  *
7854  * info.obj = self
7855  */
7856  __Pyx_TraceLine(205,0,__PYX_ERR(1, 205, __pyx_L1_error))
7857  /*else*/ {
7858  __pyx_v_info->format = NULL;
7859  }
7860  __pyx_L5:;
7861 
7862  /* "View.MemoryView":207
7863  * info.format = NULL
7864  *
7865  * info.obj = self # <<<<<<<<<<<<<<
7866  *
7867  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7868  */
7869  __Pyx_TraceLine(207,0,__PYX_ERR(1, 207, __pyx_L1_error))
7870  __Pyx_INCREF(((PyObject *)__pyx_v_self));
7871  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7872  __Pyx_GOTREF(__pyx_v_info->obj);
7873  __Pyx_DECREF(__pyx_v_info->obj);
7874  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
7875 
7876  /* "View.MemoryView":185
7877  *
7878  * @cname('getbuffer')
7879  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
7880  * cdef int bufmode = -1
7881  * if self.mode == u"c":
7882  */
7883 
7884  /* function exit code */
7885  __pyx_r = 0;
7886  goto __pyx_L0;
7887  __pyx_L1_error:;
7888  __Pyx_XDECREF(__pyx_t_3);
7889  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7890  __pyx_r = -1;
7891  if (__pyx_v_info->obj != NULL) {
7892  __Pyx_GOTREF(__pyx_v_info->obj);
7893  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7894  }
7895  goto __pyx_L2;
7896  __pyx_L0:;
7897  if (__pyx_v_info->obj == Py_None) {
7898  __Pyx_GOTREF(__pyx_v_info->obj);
7899  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
7900  }
7901  __pyx_L2:;
7902  __Pyx_TraceReturn(Py_None, 0);
7903  __Pyx_RefNannyFinishContext();
7904  return __pyx_r;
7905 }
7906 
7907 /* "View.MemoryView":211
7908  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
7909  *
7910  * def __dealloc__(array self): # <<<<<<<<<<<<<<
7911  * if self.callback_free_data != NULL:
7912  * self.callback_free_data(self.data)
7913  */
7914 
7915 /* Python wrapper */
7916 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
7917 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
7918  __Pyx_RefNannyDeclarations
7919  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
7920  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
7921 
7922  /* function exit code */
7923  __Pyx_RefNannyFinishContext();
7924 }
7925 
7926 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
7927  __Pyx_TraceDeclarations
7928  __Pyx_RefNannyDeclarations
7929  int __pyx_t_1;
7930  int __pyx_lineno = 0;
7931  const char *__pyx_filename = NULL;
7932  int __pyx_clineno = 0;
7933  __Pyx_RefNannySetupContext("__dealloc__", 0);
7934  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 211, 0, __PYX_ERR(1, 211, __pyx_L1_error));
7935 
7936  /* "View.MemoryView":212
7937  *
7938  * def __dealloc__(array self):
7939  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7940  * self.callback_free_data(self.data)
7941  * elif self.free_data:
7942  */
7943  __Pyx_TraceLine(212,0,__PYX_ERR(1, 212, __pyx_L1_error))
7944  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
7945  if (__pyx_t_1) {
7946 
7947  /* "View.MemoryView":213
7948  * def __dealloc__(array self):
7949  * if self.callback_free_data != NULL:
7950  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
7951  * elif self.free_data:
7952  * if self.dtype_is_object:
7953  */
7954  __Pyx_TraceLine(213,0,__PYX_ERR(1, 213, __pyx_L1_error))
7955  __pyx_v_self->callback_free_data(__pyx_v_self->data);
7956 
7957  /* "View.MemoryView":212
7958  *
7959  * def __dealloc__(array self):
7960  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
7961  * self.callback_free_data(self.data)
7962  * elif self.free_data:
7963  */
7964  goto __pyx_L3;
7965  }
7966 
7967  /* "View.MemoryView":214
7968  * if self.callback_free_data != NULL:
7969  * self.callback_free_data(self.data)
7970  * elif self.free_data: # <<<<<<<<<<<<<<
7971  * if self.dtype_is_object:
7972  * refcount_objects_in_slice(self.data, self._shape,
7973  */
7974  __Pyx_TraceLine(214,0,__PYX_ERR(1, 214, __pyx_L1_error))
7975  __pyx_t_1 = (__pyx_v_self->free_data != 0);
7976  if (__pyx_t_1) {
7977 
7978  /* "View.MemoryView":215
7979  * self.callback_free_data(self.data)
7980  * elif self.free_data:
7981  * if self.dtype_is_object: # <<<<<<<<<<<<<<
7982  * refcount_objects_in_slice(self.data, self._shape,
7983  * self._strides, self.ndim, False)
7984  */
7985  __Pyx_TraceLine(215,0,__PYX_ERR(1, 215, __pyx_L1_error))
7986  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
7987  if (__pyx_t_1) {
7988 
7989  /* "View.MemoryView":216
7990  * elif self.free_data:
7991  * if self.dtype_is_object:
7992  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
7993  * self._strides, self.ndim, False)
7994  * free(self.data)
7995  */
7996  __Pyx_TraceLine(216,0,__PYX_ERR(1, 216, __pyx_L1_error))
7997  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
7998 
7999  /* "View.MemoryView":215
8000  * self.callback_free_data(self.data)
8001  * elif self.free_data:
8002  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8003  * refcount_objects_in_slice(self.data, self._shape,
8004  * self._strides, self.ndim, False)
8005  */
8006  }
8007 
8008  /* "View.MemoryView":218
8009  * refcount_objects_in_slice(self.data, self._shape,
8010  * self._strides, self.ndim, False)
8011  * free(self.data) # <<<<<<<<<<<<<<
8012  * PyObject_Free(self._shape)
8013  *
8014  */
8015  __Pyx_TraceLine(218,0,__PYX_ERR(1, 218, __pyx_L1_error))
8016  free(__pyx_v_self->data);
8017 
8018  /* "View.MemoryView":214
8019  * if self.callback_free_data != NULL:
8020  * self.callback_free_data(self.data)
8021  * elif self.free_data: # <<<<<<<<<<<<<<
8022  * if self.dtype_is_object:
8023  * refcount_objects_in_slice(self.data, self._shape,
8024  */
8025  }
8026  __pyx_L3:;
8027 
8028  /* "View.MemoryView":219
8029  * self._strides, self.ndim, False)
8030  * free(self.data)
8031  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
8032  *
8033  * @property
8034  */
8035  __Pyx_TraceLine(219,0,__PYX_ERR(1, 219, __pyx_L1_error))
8036  PyObject_Free(__pyx_v_self->_shape);
8037 
8038  /* "View.MemoryView":211
8039  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8040  *
8041  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8042  * if self.callback_free_data != NULL:
8043  * self.callback_free_data(self.data)
8044  */
8045 
8046  /* function exit code */
8047  goto __pyx_L0;
8048  __pyx_L1_error:;
8049  __Pyx_WriteUnraisable("View.MemoryView.array.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
8050  __pyx_L0:;
8051  __Pyx_TraceReturn(Py_None, 0);
8052  __Pyx_RefNannyFinishContext();
8053 }
8054 
8055 /* "View.MemoryView":222
8056  *
8057  * @property
8058  * def memview(self): # <<<<<<<<<<<<<<
8059  * return self.get_memview()
8060  *
8061  */
8062 
8063 /* Python wrapper */
8064 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
8065 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
8066  PyObject *__pyx_r = 0;
8067  __Pyx_RefNannyDeclarations
8068  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
8069  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
8070 
8071  /* function exit code */
8072  __Pyx_RefNannyFinishContext();
8073  return __pyx_r;
8074 }
8075 
8076 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
8077  PyObject *__pyx_r = NULL;
8078  __Pyx_TraceDeclarations
8079  __Pyx_RefNannyDeclarations
8080  PyObject *__pyx_t_1 = NULL;
8081  int __pyx_lineno = 0;
8082  const char *__pyx_filename = NULL;
8083  int __pyx_clineno = 0;
8084  __Pyx_RefNannySetupContext("__get__", 0);
8085  __Pyx_TraceCall("__get__", __pyx_f[1], 222, 0, __PYX_ERR(1, 222, __pyx_L1_error));
8086 
8087  /* "View.MemoryView":223
8088  * @property
8089  * def memview(self):
8090  * return self.get_memview() # <<<<<<<<<<<<<<
8091  *
8092  * @cname('get_memview')
8093  */
8094  __Pyx_TraceLine(223,0,__PYX_ERR(1, 223, __pyx_L1_error))
8095  __Pyx_XDECREF(__pyx_r);
8096  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 223, __pyx_L1_error)
8097  __Pyx_GOTREF(__pyx_t_1);
8098  __pyx_r = __pyx_t_1;
8099  __pyx_t_1 = 0;
8100  goto __pyx_L0;
8101 
8102  /* "View.MemoryView":222
8103  *
8104  * @property
8105  * def memview(self): # <<<<<<<<<<<<<<
8106  * return self.get_memview()
8107  *
8108  */
8109 
8110  /* function exit code */
8111  __pyx_L1_error:;
8112  __Pyx_XDECREF(__pyx_t_1);
8113  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8114  __pyx_r = NULL;
8115  __pyx_L0:;
8116  __Pyx_XGIVEREF(__pyx_r);
8117  __Pyx_TraceReturn(__pyx_r, 0);
8118  __Pyx_RefNannyFinishContext();
8119  return __pyx_r;
8120 }
8121 
8122 /* "View.MemoryView":226
8123  *
8124  * @cname('get_memview')
8125  * cdef get_memview(self): # <<<<<<<<<<<<<<
8126  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8127  * return memoryview(self, flags, self.dtype_is_object)
8128  */
8129 
8130 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
8131  int __pyx_v_flags;
8132  PyObject *__pyx_r = NULL;
8133  __Pyx_TraceDeclarations
8134  __Pyx_RefNannyDeclarations
8135  PyObject *__pyx_t_1 = NULL;
8136  PyObject *__pyx_t_2 = NULL;
8137  PyObject *__pyx_t_3 = NULL;
8138  int __pyx_lineno = 0;
8139  const char *__pyx_filename = NULL;
8140  int __pyx_clineno = 0;
8141  __Pyx_RefNannySetupContext("get_memview", 0);
8142  __Pyx_TraceCall("get_memview", __pyx_f[1], 226, 0, __PYX_ERR(1, 226, __pyx_L1_error));
8143 
8144  /* "View.MemoryView":227
8145  * @cname('get_memview')
8146  * cdef get_memview(self):
8147  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
8148  * return memoryview(self, flags, self.dtype_is_object)
8149  *
8150  */
8151  __Pyx_TraceLine(227,0,__PYX_ERR(1, 227, __pyx_L1_error))
8152  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
8153 
8154  /* "View.MemoryView":228
8155  * cdef get_memview(self):
8156  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8157  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
8158  *
8159  * def __len__(self):
8160  */
8161  __Pyx_TraceLine(228,0,__PYX_ERR(1, 228, __pyx_L1_error))
8162  __Pyx_XDECREF(__pyx_r);
8163  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 228, __pyx_L1_error)
8164  __Pyx_GOTREF(__pyx_t_1);
8165  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8166  __Pyx_GOTREF(__pyx_t_2);
8167  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 228, __pyx_L1_error)
8168  __Pyx_GOTREF(__pyx_t_3);
8169  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8170  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8171  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
8172  __Pyx_GIVEREF(__pyx_t_1);
8173  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
8174  __Pyx_GIVEREF(__pyx_t_2);
8175  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
8176  __pyx_t_1 = 0;
8177  __pyx_t_2 = 0;
8178  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 228, __pyx_L1_error)
8179  __Pyx_GOTREF(__pyx_t_2);
8180  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8181  __pyx_r = __pyx_t_2;
8182  __pyx_t_2 = 0;
8183  goto __pyx_L0;
8184 
8185  /* "View.MemoryView":226
8186  *
8187  * @cname('get_memview')
8188  * cdef get_memview(self): # <<<<<<<<<<<<<<
8189  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
8190  * return memoryview(self, flags, self.dtype_is_object)
8191  */
8192 
8193  /* function exit code */
8194  __pyx_L1_error:;
8195  __Pyx_XDECREF(__pyx_t_1);
8196  __Pyx_XDECREF(__pyx_t_2);
8197  __Pyx_XDECREF(__pyx_t_3);
8198  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
8199  __pyx_r = 0;
8200  __pyx_L0:;
8201  __Pyx_XGIVEREF(__pyx_r);
8202  __Pyx_TraceReturn(__pyx_r, 0);
8203  __Pyx_RefNannyFinishContext();
8204  return __pyx_r;
8205 }
8206 
8207 /* "View.MemoryView":230
8208  * return memoryview(self, flags, self.dtype_is_object)
8209  *
8210  * def __len__(self): # <<<<<<<<<<<<<<
8211  * return self._shape[0]
8212  *
8213  */
8214 
8215 /* Python wrapper */
8216 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
8217 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
8218  Py_ssize_t __pyx_r;
8219  __Pyx_RefNannyDeclarations
8220  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
8221  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
8222 
8223  /* function exit code */
8224  __Pyx_RefNannyFinishContext();
8225  return __pyx_r;
8226 }
8227 
8228 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
8229  Py_ssize_t __pyx_r;
8230  __Pyx_TraceDeclarations
8231  __Pyx_RefNannyDeclarations
8232  int __pyx_lineno = 0;
8233  const char *__pyx_filename = NULL;
8234  int __pyx_clineno = 0;
8235  __Pyx_RefNannySetupContext("__len__", 0);
8236  __Pyx_TraceCall("__len__", __pyx_f[1], 230, 0, __PYX_ERR(1, 230, __pyx_L1_error));
8237 
8238  /* "View.MemoryView":231
8239  *
8240  * def __len__(self):
8241  * return self._shape[0] # <<<<<<<<<<<<<<
8242  *
8243  * def __getattr__(self, attr):
8244  */
8245  __Pyx_TraceLine(231,0,__PYX_ERR(1, 231, __pyx_L1_error))
8246  __pyx_r = (__pyx_v_self->_shape[0]);
8247  goto __pyx_L0;
8248 
8249  /* "View.MemoryView":230
8250  * return memoryview(self, flags, self.dtype_is_object)
8251  *
8252  * def __len__(self): # <<<<<<<<<<<<<<
8253  * return self._shape[0]
8254  *
8255  */
8256 
8257  /* function exit code */
8258  __pyx_L1_error:;
8259  __Pyx_AddTraceback("View.MemoryView.array.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8260  __pyx_r = -1;
8261  __pyx_L0:;
8262  __Pyx_TraceReturn(Py_None, 0);
8263  __Pyx_RefNannyFinishContext();
8264  return __pyx_r;
8265 }
8266 
8267 /* "View.MemoryView":233
8268  * return self._shape[0]
8269  *
8270  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8271  * return getattr(self.memview, attr)
8272  *
8273  */
8274 
8275 /* Python wrapper */
8276 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
8277 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
8278  PyObject *__pyx_r = 0;
8279  __Pyx_RefNannyDeclarations
8280  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
8281  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
8282 
8283  /* function exit code */
8284  __Pyx_RefNannyFinishContext();
8285  return __pyx_r;
8286 }
8287 
8288 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
8289  PyObject *__pyx_r = NULL;
8290  __Pyx_TraceDeclarations
8291  __Pyx_RefNannyDeclarations
8292  PyObject *__pyx_t_1 = NULL;
8293  PyObject *__pyx_t_2 = NULL;
8294  int __pyx_lineno = 0;
8295  const char *__pyx_filename = NULL;
8296  int __pyx_clineno = 0;
8297  __Pyx_RefNannySetupContext("__getattr__", 0);
8298  __Pyx_TraceCall("__getattr__", __pyx_f[1], 233, 0, __PYX_ERR(1, 233, __pyx_L1_error));
8299 
8300  /* "View.MemoryView":234
8301  *
8302  * def __getattr__(self, attr):
8303  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
8304  *
8305  * def __getitem__(self, item):
8306  */
8307  __Pyx_TraceLine(234,0,__PYX_ERR(1, 234, __pyx_L1_error))
8308  __Pyx_XDECREF(__pyx_r);
8309  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 234, __pyx_L1_error)
8310  __Pyx_GOTREF(__pyx_t_1);
8311  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 234, __pyx_L1_error)
8312  __Pyx_GOTREF(__pyx_t_2);
8313  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8314  __pyx_r = __pyx_t_2;
8315  __pyx_t_2 = 0;
8316  goto __pyx_L0;
8317 
8318  /* "View.MemoryView":233
8319  * return self._shape[0]
8320  *
8321  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
8322  * return getattr(self.memview, attr)
8323  *
8324  */
8325 
8326  /* function exit code */
8327  __pyx_L1_error:;
8328  __Pyx_XDECREF(__pyx_t_1);
8329  __Pyx_XDECREF(__pyx_t_2);
8330  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8331  __pyx_r = NULL;
8332  __pyx_L0:;
8333  __Pyx_XGIVEREF(__pyx_r);
8334  __Pyx_TraceReturn(__pyx_r, 0);
8335  __Pyx_RefNannyFinishContext();
8336  return __pyx_r;
8337 }
8338 
8339 /* "View.MemoryView":236
8340  * return getattr(self.memview, attr)
8341  *
8342  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8343  * return self.memview[item]
8344  *
8345  */
8346 
8347 /* Python wrapper */
8348 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
8349 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
8350  PyObject *__pyx_r = 0;
8351  __Pyx_RefNannyDeclarations
8352  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
8353  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
8354 
8355  /* function exit code */
8356  __Pyx_RefNannyFinishContext();
8357  return __pyx_r;
8358 }
8359 
8360 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
8361  PyObject *__pyx_r = NULL;
8362  __Pyx_TraceDeclarations
8363  __Pyx_RefNannyDeclarations
8364  PyObject *__pyx_t_1 = NULL;
8365  PyObject *__pyx_t_2 = NULL;
8366  int __pyx_lineno = 0;
8367  const char *__pyx_filename = NULL;
8368  int __pyx_clineno = 0;
8369  __Pyx_RefNannySetupContext("__getitem__", 0);
8370  __Pyx_TraceCall("__getitem__", __pyx_f[1], 236, 0, __PYX_ERR(1, 236, __pyx_L1_error));
8371 
8372  /* "View.MemoryView":237
8373  *
8374  * def __getitem__(self, item):
8375  * return self.memview[item] # <<<<<<<<<<<<<<
8376  *
8377  * def __setitem__(self, item, value):
8378  */
8379  __Pyx_TraceLine(237,0,__PYX_ERR(1, 237, __pyx_L1_error))
8380  __Pyx_XDECREF(__pyx_r);
8381  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 237, __pyx_L1_error)
8382  __Pyx_GOTREF(__pyx_t_1);
8383  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 237, __pyx_L1_error)
8384  __Pyx_GOTREF(__pyx_t_2);
8385  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8386  __pyx_r = __pyx_t_2;
8387  __pyx_t_2 = 0;
8388  goto __pyx_L0;
8389 
8390  /* "View.MemoryView":236
8391  * return getattr(self.memview, attr)
8392  *
8393  * def __getitem__(self, item): # <<<<<<<<<<<<<<
8394  * return self.memview[item]
8395  *
8396  */
8397 
8398  /* function exit code */
8399  __pyx_L1_error:;
8400  __Pyx_XDECREF(__pyx_t_1);
8401  __Pyx_XDECREF(__pyx_t_2);
8402  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8403  __pyx_r = NULL;
8404  __pyx_L0:;
8405  __Pyx_XGIVEREF(__pyx_r);
8406  __Pyx_TraceReturn(__pyx_r, 0);
8407  __Pyx_RefNannyFinishContext();
8408  return __pyx_r;
8409 }
8410 
8411 /* "View.MemoryView":239
8412  * return self.memview[item]
8413  *
8414  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8415  * self.memview[item] = value
8416  *
8417  */
8418 
8419 /* Python wrapper */
8420 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
8421 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8422  int __pyx_r;
8423  __Pyx_RefNannyDeclarations
8424  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
8425  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
8426 
8427  /* function exit code */
8428  __Pyx_RefNannyFinishContext();
8429  return __pyx_r;
8430 }
8431 
8432 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
8433  int __pyx_r;
8434  __Pyx_TraceDeclarations
8435  __Pyx_RefNannyDeclarations
8436  PyObject *__pyx_t_1 = NULL;
8437  int __pyx_lineno = 0;
8438  const char *__pyx_filename = NULL;
8439  int __pyx_clineno = 0;
8440  __Pyx_RefNannySetupContext("__setitem__", 0);
8441  __Pyx_TraceCall("__setitem__", __pyx_f[1], 239, 0, __PYX_ERR(1, 239, __pyx_L1_error));
8442 
8443  /* "View.MemoryView":240
8444  *
8445  * def __setitem__(self, item, value):
8446  * self.memview[item] = value # <<<<<<<<<<<<<<
8447  *
8448  *
8449  */
8450  __Pyx_TraceLine(240,0,__PYX_ERR(1, 240, __pyx_L1_error))
8451  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 240, __pyx_L1_error)
8452  __Pyx_GOTREF(__pyx_t_1);
8453  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(1, 240, __pyx_L1_error)
8454  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8455 
8456  /* "View.MemoryView":239
8457  * return self.memview[item]
8458  *
8459  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
8460  * self.memview[item] = value
8461  *
8462  */
8463 
8464  /* function exit code */
8465  __pyx_r = 0;
8466  goto __pyx_L0;
8467  __pyx_L1_error:;
8468  __Pyx_XDECREF(__pyx_t_1);
8469  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8470  __pyx_r = -1;
8471  __pyx_L0:;
8472  __Pyx_TraceReturn(Py_None, 0);
8473  __Pyx_RefNannyFinishContext();
8474  return __pyx_r;
8475 }
8476 
8477 /* "(tree fragment)":1
8478  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8479  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8480  * def __setstate_cython__(self, __pyx_state):
8481  */
8482 
8483 /* Python wrapper */
8484 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8485 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
8486 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8487  PyObject *__pyx_r = 0;
8488  __Pyx_RefNannyDeclarations
8489  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8490  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
8491 
8492  /* function exit code */
8493  __Pyx_RefNannyFinishContext();
8494  return __pyx_r;
8495 }
8496 
8497 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
8498  PyObject *__pyx_r = NULL;
8499  __Pyx_TraceDeclarations
8500  __Pyx_RefNannyDeclarations
8501  PyObject *__pyx_t_1 = NULL;
8502  int __pyx_lineno = 0;
8503  const char *__pyx_filename = NULL;
8504  int __pyx_clineno = 0;
8505  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8506  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8507 
8508  /* "(tree fragment)":2
8509  * def __reduce_cython__(self):
8510  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8511  * def __setstate_cython__(self, __pyx_state):
8512  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8513  */
8514  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
8515  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
8516  __Pyx_GOTREF(__pyx_t_1);
8517  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8518  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8519  __PYX_ERR(1, 2, __pyx_L1_error)
8520 
8521  /* "(tree fragment)":1
8522  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8523  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8524  * def __setstate_cython__(self, __pyx_state):
8525  */
8526 
8527  /* function exit code */
8528  __pyx_L1_error:;
8529  __Pyx_XDECREF(__pyx_t_1);
8530  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8531  __pyx_r = NULL;
8532  __Pyx_XGIVEREF(__pyx_r);
8533  __Pyx_TraceReturn(__pyx_r, 0);
8534  __Pyx_RefNannyFinishContext();
8535  return __pyx_r;
8536 }
8537 
8538 /* "(tree fragment)":3
8539  * def __reduce_cython__(self):
8540  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8541  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8542  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8543  */
8544 
8545 /* Python wrapper */
8546 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
8547 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
8548 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
8549  PyObject *__pyx_r = 0;
8550  __Pyx_RefNannyDeclarations
8551  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
8552  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
8553 
8554  /* function exit code */
8555  __Pyx_RefNannyFinishContext();
8556  return __pyx_r;
8557 }
8558 
8559 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
8560  PyObject *__pyx_r = NULL;
8561  __Pyx_TraceDeclarations
8562  __Pyx_RefNannyDeclarations
8563  PyObject *__pyx_t_1 = NULL;
8564  int __pyx_lineno = 0;
8565  const char *__pyx_filename = NULL;
8566  int __pyx_clineno = 0;
8567  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
8568  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
8569 
8570  /* "(tree fragment)":4
8571  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8572  * def __setstate_cython__(self, __pyx_state):
8573  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
8574  */
8575  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
8576  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
8577  __Pyx_GOTREF(__pyx_t_1);
8578  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
8579  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
8580  __PYX_ERR(1, 4, __pyx_L1_error)
8581 
8582  /* "(tree fragment)":3
8583  * def __reduce_cython__(self):
8584  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8585  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
8586  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
8587  */
8588 
8589  /* function exit code */
8590  __pyx_L1_error:;
8591  __Pyx_XDECREF(__pyx_t_1);
8592  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8593  __pyx_r = NULL;
8594  __Pyx_XGIVEREF(__pyx_r);
8595  __Pyx_TraceReturn(__pyx_r, 0);
8596  __Pyx_RefNannyFinishContext();
8597  return __pyx_r;
8598 }
8599 
8600 /* "View.MemoryView":244
8601  *
8602  * @cname("__pyx_array_new")
8603  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8604  * char *mode, char *buf):
8605  * cdef array result
8606  */
8607 
8608 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
8609  struct __pyx_array_obj *__pyx_v_result = 0;
8610  struct __pyx_array_obj *__pyx_r = NULL;
8611  __Pyx_TraceDeclarations
8612  __Pyx_RefNannyDeclarations
8613  int __pyx_t_1;
8614  PyObject *__pyx_t_2 = NULL;
8615  PyObject *__pyx_t_3 = NULL;
8616  PyObject *__pyx_t_4 = NULL;
8617  PyObject *__pyx_t_5 = NULL;
8618  int __pyx_lineno = 0;
8619  const char *__pyx_filename = NULL;
8620  int __pyx_clineno = 0;
8621  __Pyx_RefNannySetupContext("array_cwrapper", 0);
8622  __Pyx_TraceCall("array_cwrapper", __pyx_f[1], 244, 0, __PYX_ERR(1, 244, __pyx_L1_error));
8623 
8624  /* "View.MemoryView":248
8625  * cdef array result
8626  *
8627  * if buf == NULL: # <<<<<<<<<<<<<<
8628  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8629  * else:
8630  */
8631  __Pyx_TraceLine(248,0,__PYX_ERR(1, 248, __pyx_L1_error))
8632  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
8633  if (__pyx_t_1) {
8634 
8635  /* "View.MemoryView":249
8636  *
8637  * if buf == NULL:
8638  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
8639  * else:
8640  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8641  */
8642  __Pyx_TraceLine(249,0,__PYX_ERR(1, 249, __pyx_L1_error))
8643  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 249, __pyx_L1_error)
8644  __Pyx_GOTREF(__pyx_t_2);
8645  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 249, __pyx_L1_error)
8646  __Pyx_GOTREF(__pyx_t_3);
8647  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8648  __Pyx_GOTREF(__pyx_t_4);
8649  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 249, __pyx_L1_error)
8650  __Pyx_GOTREF(__pyx_t_5);
8651  __Pyx_INCREF(__pyx_v_shape);
8652  __Pyx_GIVEREF(__pyx_v_shape);
8653  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
8654  __Pyx_GIVEREF(__pyx_t_2);
8655  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
8656  __Pyx_GIVEREF(__pyx_t_3);
8657  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
8658  __Pyx_GIVEREF(__pyx_t_4);
8659  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
8660  __pyx_t_2 = 0;
8661  __pyx_t_3 = 0;
8662  __pyx_t_4 = 0;
8663  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 249, __pyx_L1_error)
8664  __Pyx_GOTREF(__pyx_t_4);
8665  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8666  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
8667  __pyx_t_4 = 0;
8668 
8669  /* "View.MemoryView":248
8670  * cdef array result
8671  *
8672  * if buf == NULL: # <<<<<<<<<<<<<<
8673  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8674  * else:
8675  */
8676  goto __pyx_L3;
8677  }
8678 
8679  /* "View.MemoryView":251
8680  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8681  * else:
8682  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8683  * allocate_buffer=False)
8684  * result.data = buf
8685  */
8686  __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
8687  /*else*/ {
8688  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 251, __pyx_L1_error)
8689  __Pyx_GOTREF(__pyx_t_4);
8690  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8691  __Pyx_GOTREF(__pyx_t_5);
8692  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 251, __pyx_L1_error)
8693  __Pyx_GOTREF(__pyx_t_3);
8694  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 251, __pyx_L1_error)
8695  __Pyx_GOTREF(__pyx_t_2);
8696  __Pyx_INCREF(__pyx_v_shape);
8697  __Pyx_GIVEREF(__pyx_v_shape);
8698  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
8699  __Pyx_GIVEREF(__pyx_t_4);
8700  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
8701  __Pyx_GIVEREF(__pyx_t_5);
8702  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
8703  __Pyx_GIVEREF(__pyx_t_3);
8704  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
8705  __pyx_t_4 = 0;
8706  __pyx_t_5 = 0;
8707  __pyx_t_3 = 0;
8708 
8709  /* "View.MemoryView":252
8710  * else:
8711  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8712  * allocate_buffer=False) # <<<<<<<<<<<<<<
8713  * result.data = buf
8714  *
8715  */
8716  __Pyx_TraceLine(252,0,__PYX_ERR(1, 252, __pyx_L1_error))
8717  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 252, __pyx_L1_error)
8718  __Pyx_GOTREF(__pyx_t_3);
8719  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(1, 252, __pyx_L1_error)
8720 
8721  /* "View.MemoryView":251
8722  * result = array(shape, itemsize, format, mode.decode('ASCII'))
8723  * else:
8724  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
8725  * allocate_buffer=False)
8726  * result.data = buf
8727  */
8728  __Pyx_TraceLine(251,0,__PYX_ERR(1, 251, __pyx_L1_error))
8729  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 251, __pyx_L1_error)
8730  __Pyx_GOTREF(__pyx_t_5);
8731  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
8732  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8733  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
8734  __pyx_t_5 = 0;
8735 
8736  /* "View.MemoryView":253
8737  * result = array(shape, itemsize, format, mode.decode('ASCII'),
8738  * allocate_buffer=False)
8739  * result.data = buf # <<<<<<<<<<<<<<
8740  *
8741  * return result
8742  */
8743  __Pyx_TraceLine(253,0,__PYX_ERR(1, 253, __pyx_L1_error))
8744  __pyx_v_result->data = __pyx_v_buf;
8745  }
8746  __pyx_L3:;
8747 
8748  /* "View.MemoryView":255
8749  * result.data = buf
8750  *
8751  * return result # <<<<<<<<<<<<<<
8752  *
8753  *
8754  */
8755  __Pyx_TraceLine(255,0,__PYX_ERR(1, 255, __pyx_L1_error))
8756  __Pyx_XDECREF(((PyObject *)__pyx_r));
8757  __Pyx_INCREF(((PyObject *)__pyx_v_result));
8758  __pyx_r = __pyx_v_result;
8759  goto __pyx_L0;
8760 
8761  /* "View.MemoryView":244
8762  *
8763  * @cname("__pyx_array_new")
8764  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
8765  * char *mode, char *buf):
8766  * cdef array result
8767  */
8768 
8769  /* function exit code */
8770  __pyx_L1_error:;
8771  __Pyx_XDECREF(__pyx_t_2);
8772  __Pyx_XDECREF(__pyx_t_3);
8773  __Pyx_XDECREF(__pyx_t_4);
8774  __Pyx_XDECREF(__pyx_t_5);
8775  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
8776  __pyx_r = 0;
8777  __pyx_L0:;
8778  __Pyx_XDECREF((PyObject *)__pyx_v_result);
8779  __Pyx_XGIVEREF((PyObject *)__pyx_r);
8780  __Pyx_TraceReturn(__pyx_r, 0);
8781  __Pyx_RefNannyFinishContext();
8782  return __pyx_r;
8783 }
8784 
8785 /* "View.MemoryView":281
8786  * cdef class Enum(object):
8787  * cdef object name
8788  * def __init__(self, name): # <<<<<<<<<<<<<<
8789  * self.name = name
8790  * def __repr__(self):
8791  */
8792 
8793 /* Python wrapper */
8794 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
8795 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8796  PyObject *__pyx_v_name = 0;
8797  int __pyx_lineno = 0;
8798  const char *__pyx_filename = NULL;
8799  int __pyx_clineno = 0;
8800  int __pyx_r;
8801  __Pyx_RefNannyDeclarations
8802  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
8803  {
8804  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
8805  PyObject* values[1] = {0};
8806  if (unlikely(__pyx_kwds)) {
8807  Py_ssize_t kw_args;
8808  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8809  switch (pos_args) {
8810  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8811  CYTHON_FALLTHROUGH;
8812  case 0: break;
8813  default: goto __pyx_L5_argtuple_error;
8814  }
8815  kw_args = PyDict_Size(__pyx_kwds);
8816  switch (pos_args) {
8817  case 0:
8818  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
8819  else goto __pyx_L5_argtuple_error;
8820  }
8821  if (unlikely(kw_args > 0)) {
8822  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 281, __pyx_L3_error)
8823  }
8824  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
8825  goto __pyx_L5_argtuple_error;
8826  } else {
8827  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8828  }
8829  __pyx_v_name = values[0];
8830  }
8831  goto __pyx_L4_argument_unpacking_done;
8832  __pyx_L5_argtuple_error:;
8833  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 281, __pyx_L3_error)
8834  __pyx_L3_error:;
8835  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8836  __Pyx_RefNannyFinishContext();
8837  return -1;
8838  __pyx_L4_argument_unpacking_done:;
8839  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
8840 
8841  /* function exit code */
8842  __Pyx_RefNannyFinishContext();
8843  return __pyx_r;
8844 }
8845 
8846 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
8847  int __pyx_r;
8848  __Pyx_TraceDeclarations
8849  __Pyx_RefNannyDeclarations
8850  int __pyx_lineno = 0;
8851  const char *__pyx_filename = NULL;
8852  int __pyx_clineno = 0;
8853  __Pyx_RefNannySetupContext("__init__", 0);
8854  __Pyx_TraceCall("__init__", __pyx_f[1], 281, 0, __PYX_ERR(1, 281, __pyx_L1_error));
8855 
8856  /* "View.MemoryView":282
8857  * cdef object name
8858  * def __init__(self, name):
8859  * self.name = name # <<<<<<<<<<<<<<
8860  * def __repr__(self):
8861  * return self.name
8862  */
8863  __Pyx_TraceLine(282,0,__PYX_ERR(1, 282, __pyx_L1_error))
8864  __Pyx_INCREF(__pyx_v_name);
8865  __Pyx_GIVEREF(__pyx_v_name);
8866  __Pyx_GOTREF(__pyx_v_self->name);
8867  __Pyx_DECREF(__pyx_v_self->name);
8868  __pyx_v_self->name = __pyx_v_name;
8869 
8870  /* "View.MemoryView":281
8871  * cdef class Enum(object):
8872  * cdef object name
8873  * def __init__(self, name): # <<<<<<<<<<<<<<
8874  * self.name = name
8875  * def __repr__(self):
8876  */
8877 
8878  /* function exit code */
8879  __pyx_r = 0;
8880  goto __pyx_L0;
8881  __pyx_L1_error:;
8882  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8883  __pyx_r = -1;
8884  __pyx_L0:;
8885  __Pyx_TraceReturn(Py_None, 0);
8886  __Pyx_RefNannyFinishContext();
8887  return __pyx_r;
8888 }
8889 
8890 /* "View.MemoryView":283
8891  * def __init__(self, name):
8892  * self.name = name
8893  * def __repr__(self): # <<<<<<<<<<<<<<
8894  * return self.name
8895  *
8896  */
8897 
8898 /* Python wrapper */
8899 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
8900 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
8901  PyObject *__pyx_r = 0;
8902  __Pyx_RefNannyDeclarations
8903  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
8904  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8905 
8906  /* function exit code */
8907  __Pyx_RefNannyFinishContext();
8908  return __pyx_r;
8909 }
8910 
8911 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8912  PyObject *__pyx_r = NULL;
8913  __Pyx_TraceDeclarations
8914  __Pyx_RefNannyDeclarations
8915  int __pyx_lineno = 0;
8916  const char *__pyx_filename = NULL;
8917  int __pyx_clineno = 0;
8918  __Pyx_RefNannySetupContext("__repr__", 0);
8919  __Pyx_TraceCall("__repr__", __pyx_f[1], 283, 0, __PYX_ERR(1, 283, __pyx_L1_error));
8920 
8921  /* "View.MemoryView":284
8922  * self.name = name
8923  * def __repr__(self):
8924  * return self.name # <<<<<<<<<<<<<<
8925  *
8926  * cdef generic = Enum("<strided and direct or indirect>")
8927  */
8928  __Pyx_TraceLine(284,0,__PYX_ERR(1, 284, __pyx_L1_error))
8929  __Pyx_XDECREF(__pyx_r);
8930  __Pyx_INCREF(__pyx_v_self->name);
8931  __pyx_r = __pyx_v_self->name;
8932  goto __pyx_L0;
8933 
8934  /* "View.MemoryView":283
8935  * def __init__(self, name):
8936  * self.name = name
8937  * def __repr__(self): # <<<<<<<<<<<<<<
8938  * return self.name
8939  *
8940  */
8941 
8942  /* function exit code */
8943  __pyx_L1_error:;
8944  __Pyx_AddTraceback("View.MemoryView.Enum.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8945  __pyx_r = NULL;
8946  __pyx_L0:;
8947  __Pyx_XGIVEREF(__pyx_r);
8948  __Pyx_TraceReturn(__pyx_r, 0);
8949  __Pyx_RefNannyFinishContext();
8950  return __pyx_r;
8951 }
8952 
8953 /* "(tree fragment)":1
8954  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
8955  * cdef tuple state
8956  * cdef object _dict
8957  */
8958 
8959 /* Python wrapper */
8960 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
8961 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
8962 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
8963  PyObject *__pyx_r = 0;
8964  __Pyx_RefNannyDeclarations
8965  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
8966  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
8967 
8968  /* function exit code */
8969  __Pyx_RefNannyFinishContext();
8970  return __pyx_r;
8971 }
8972 
8973 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
8974  PyObject *__pyx_v_state = 0;
8975  PyObject *__pyx_v__dict = 0;
8976  int __pyx_v_use_setstate;
8977  PyObject *__pyx_r = NULL;
8978  __Pyx_TraceDeclarations
8979  __Pyx_RefNannyDeclarations
8980  PyObject *__pyx_t_1 = NULL;
8981  int __pyx_t_2;
8982  int __pyx_t_3;
8983  PyObject *__pyx_t_4 = NULL;
8984  PyObject *__pyx_t_5 = NULL;
8985  int __pyx_lineno = 0;
8986  const char *__pyx_filename = NULL;
8987  int __pyx_clineno = 0;
8988  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
8989  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
8990 
8991  /* "(tree fragment)":5
8992  * cdef object _dict
8993  * cdef bint use_setstate
8994  * state = (self.name,) # <<<<<<<<<<<<<<
8995  * _dict = getattr(self, '__dict__', None)
8996  * if _dict is not None:
8997  */
8998  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
8999  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
9000  __Pyx_GOTREF(__pyx_t_1);
9001  __Pyx_INCREF(__pyx_v_self->name);
9002  __Pyx_GIVEREF(__pyx_v_self->name);
9003  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9004  __pyx_v_state = ((PyObject*)__pyx_t_1);
9005  __pyx_t_1 = 0;
9006 
9007  /* "(tree fragment)":6
9008  * cdef bint use_setstate
9009  * state = (self.name,)
9010  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9011  * if _dict is not None:
9012  * state += (_dict,)
9013  */
9014  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
9015  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 6, __pyx_L1_error)
9016  __Pyx_GOTREF(__pyx_t_1);
9017  __pyx_v__dict = __pyx_t_1;
9018  __pyx_t_1 = 0;
9019 
9020  /* "(tree fragment)":7
9021  * state = (self.name,)
9022  * _dict = getattr(self, '__dict__', None)
9023  * if _dict is not None: # <<<<<<<<<<<<<<
9024  * state += (_dict,)
9025  * use_setstate = True
9026  */
9027  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
9028  __pyx_t_2 = (__pyx_v__dict != Py_None);
9029  __pyx_t_3 = (__pyx_t_2 != 0);
9030  if (__pyx_t_3) {
9031 
9032  /* "(tree fragment)":8
9033  * _dict = getattr(self, '__dict__', None)
9034  * if _dict is not None:
9035  * state += (_dict,) # <<<<<<<<<<<<<<
9036  * use_setstate = True
9037  * else:
9038  */
9039  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
9040  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
9041  __Pyx_GOTREF(__pyx_t_1);
9042  __Pyx_INCREF(__pyx_v__dict);
9043  __Pyx_GIVEREF(__pyx_v__dict);
9044  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9045  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 8, __pyx_L1_error)
9046  __Pyx_GOTREF(__pyx_t_4);
9047  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9048  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9049  __pyx_t_4 = 0;
9050 
9051  /* "(tree fragment)":9
9052  * if _dict is not None:
9053  * state += (_dict,)
9054  * use_setstate = True # <<<<<<<<<<<<<<
9055  * else:
9056  * use_setstate = self.name is not None
9057  */
9058  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
9059  __pyx_v_use_setstate = 1;
9060 
9061  /* "(tree fragment)":7
9062  * state = (self.name,)
9063  * _dict = getattr(self, '__dict__', None)
9064  * if _dict is not None: # <<<<<<<<<<<<<<
9065  * state += (_dict,)
9066  * use_setstate = True
9067  */
9068  goto __pyx_L3;
9069  }
9070 
9071  /* "(tree fragment)":11
9072  * use_setstate = True
9073  * else:
9074  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9075  * if use_setstate:
9076  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9077  */
9078  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
9079  /*else*/ {
9080  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9081  __pyx_v_use_setstate = __pyx_t_3;
9082  }
9083  __pyx_L3:;
9084 
9085  /* "(tree fragment)":12
9086  * else:
9087  * use_setstate = self.name is not None
9088  * if use_setstate: # <<<<<<<<<<<<<<
9089  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9090  * else:
9091  */
9092  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
9093  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9094  if (__pyx_t_3) {
9095 
9096  /* "(tree fragment)":13
9097  * use_setstate = self.name is not None
9098  * if use_setstate:
9099  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9100  * else:
9101  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9102  */
9103  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
9104  __Pyx_XDECREF(__pyx_r);
9105  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 13, __pyx_L1_error)
9106  __Pyx_GOTREF(__pyx_t_4);
9107  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
9108  __Pyx_GOTREF(__pyx_t_1);
9109  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9110  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9111  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9112  __Pyx_INCREF(__pyx_int_184977713);
9113  __Pyx_GIVEREF(__pyx_int_184977713);
9114  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9115  __Pyx_INCREF(Py_None);
9116  __Pyx_GIVEREF(Py_None);
9117  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9118  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
9119  __Pyx_GOTREF(__pyx_t_5);
9120  __Pyx_GIVEREF(__pyx_t_4);
9121  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9122  __Pyx_GIVEREF(__pyx_t_1);
9123  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9124  __Pyx_INCREF(__pyx_v_state);
9125  __Pyx_GIVEREF(__pyx_v_state);
9126  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9127  __pyx_t_4 = 0;
9128  __pyx_t_1 = 0;
9129  __pyx_r = __pyx_t_5;
9130  __pyx_t_5 = 0;
9131  goto __pyx_L0;
9132 
9133  /* "(tree fragment)":12
9134  * else:
9135  * use_setstate = self.name is not None
9136  * if use_setstate: # <<<<<<<<<<<<<<
9137  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9138  * else:
9139  */
9140  }
9141 
9142  /* "(tree fragment)":15
9143  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9144  * else:
9145  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9146  * def __setstate_cython__(self, __pyx_state):
9147  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9148  */
9149  __Pyx_TraceLine(15,0,__PYX_ERR(1, 15, __pyx_L1_error))
9150  /*else*/ {
9151  __Pyx_XDECREF(__pyx_r);
9152  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
9153  __Pyx_GOTREF(__pyx_t_5);
9154  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
9155  __Pyx_GOTREF(__pyx_t_1);
9156  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9157  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9158  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9159  __Pyx_INCREF(__pyx_int_184977713);
9160  __Pyx_GIVEREF(__pyx_int_184977713);
9161  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9162  __Pyx_INCREF(__pyx_v_state);
9163  __Pyx_GIVEREF(__pyx_v_state);
9164  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
9165  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 15, __pyx_L1_error)
9166  __Pyx_GOTREF(__pyx_t_4);
9167  __Pyx_GIVEREF(__pyx_t_5);
9168  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
9169  __Pyx_GIVEREF(__pyx_t_1);
9170  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
9171  __pyx_t_5 = 0;
9172  __pyx_t_1 = 0;
9173  __pyx_r = __pyx_t_4;
9174  __pyx_t_4 = 0;
9175  goto __pyx_L0;
9176  }
9177 
9178  /* "(tree fragment)":1
9179  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9180  * cdef tuple state
9181  * cdef object _dict
9182  */
9183 
9184  /* function exit code */
9185  __pyx_L1_error:;
9186  __Pyx_XDECREF(__pyx_t_1);
9187  __Pyx_XDECREF(__pyx_t_4);
9188  __Pyx_XDECREF(__pyx_t_5);
9189  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9190  __pyx_r = NULL;
9191  __pyx_L0:;
9192  __Pyx_XDECREF(__pyx_v_state);
9193  __Pyx_XDECREF(__pyx_v__dict);
9194  __Pyx_XGIVEREF(__pyx_r);
9195  __Pyx_TraceReturn(__pyx_r, 0);
9196  __Pyx_RefNannyFinishContext();
9197  return __pyx_r;
9198 }
9199 
9200 /* "(tree fragment)":16
9201  * else:
9202  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9203  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9204  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9205  */
9206 
9207 /* Python wrapper */
9208 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9209 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
9210 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9211  PyObject *__pyx_r = 0;
9212  __Pyx_RefNannyDeclarations
9213  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9214  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9215 
9216  /* function exit code */
9217  __Pyx_RefNannyFinishContext();
9218  return __pyx_r;
9219 }
9220 
9221 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9222  PyObject *__pyx_r = NULL;
9223  __Pyx_TraceDeclarations
9224  __Pyx_RefNannyDeclarations
9225  PyObject *__pyx_t_1 = NULL;
9226  int __pyx_lineno = 0;
9227  const char *__pyx_filename = NULL;
9228  int __pyx_clineno = 0;
9229  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9230  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 16, 0, __PYX_ERR(1, 16, __pyx_L1_error));
9231 
9232  /* "(tree fragment)":17
9233  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9234  * def __setstate_cython__(self, __pyx_state):
9235  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
9236  */
9237  __Pyx_TraceLine(17,0,__PYX_ERR(1, 17, __pyx_L1_error))
9238  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 17, __pyx_L1_error)
9239  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
9240  __Pyx_GOTREF(__pyx_t_1);
9241  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9242 
9243  /* "(tree fragment)":16
9244  * else:
9245  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9246  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9247  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
9248  */
9249 
9250  /* function exit code */
9251  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
9252  goto __pyx_L0;
9253  __pyx_L1_error:;
9254  __Pyx_XDECREF(__pyx_t_1);
9255  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9256  __pyx_r = NULL;
9257  __pyx_L0:;
9258  __Pyx_XGIVEREF(__pyx_r);
9259  __Pyx_TraceReturn(__pyx_r, 0);
9260  __Pyx_RefNannyFinishContext();
9261  return __pyx_r;
9262 }
9263 
9264 /* "View.MemoryView":298
9265  *
9266  * @cname('__pyx_align_pointer')
9267  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9268  * "Align pointer memory on a given boundary"
9269  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9270  */
9271 
9272 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
9273  Py_intptr_t __pyx_v_aligned_p;
9274  size_t __pyx_v_offset;
9275  void *__pyx_r;
9276  __Pyx_TraceDeclarations
9277  int __pyx_t_1;
9278  int __pyx_lineno = 0;
9279  const char *__pyx_filename = NULL;
9280  int __pyx_clineno = 0;
9281  __Pyx_TraceCall("align_pointer", __pyx_f[1], 298, 1, __PYX_ERR(1, 298, __pyx_L1_error));
9282 
9283  /* "View.MemoryView":300
9284  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
9285  * "Align pointer memory on a given boundary"
9286  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
9287  * cdef size_t offset
9288  *
9289  */
9290  __Pyx_TraceLine(300,1,__PYX_ERR(1, 300, __pyx_L1_error))
9291  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
9292 
9293  /* "View.MemoryView":304
9294  *
9295  * with cython.cdivision(True):
9296  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
9297  *
9298  * if offset > 0:
9299  */
9300  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
9301 
9302  /* "View.MemoryView":306
9303  * offset = aligned_p % alignment
9304  *
9305  * if offset > 0: # <<<<<<<<<<<<<<
9306  * aligned_p += alignment - offset
9307  *
9308  */
9309  __Pyx_TraceLine(306,1,__PYX_ERR(1, 306, __pyx_L1_error))
9310  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
9311  if (__pyx_t_1) {
9312 
9313  /* "View.MemoryView":307
9314  *
9315  * if offset > 0:
9316  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
9317  *
9318  * return <void *> aligned_p
9319  */
9320  __Pyx_TraceLine(307,1,__PYX_ERR(1, 307, __pyx_L1_error))
9321  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
9322 
9323  /* "View.MemoryView":306
9324  * offset = aligned_p % alignment
9325  *
9326  * if offset > 0: # <<<<<<<<<<<<<<
9327  * aligned_p += alignment - offset
9328  *
9329  */
9330  }
9331 
9332  /* "View.MemoryView":309
9333  * aligned_p += alignment - offset
9334  *
9335  * return <void *> aligned_p # <<<<<<<<<<<<<<
9336  *
9337  *
9338  */
9339  __Pyx_TraceLine(309,1,__PYX_ERR(1, 309, __pyx_L1_error))
9340  __pyx_r = ((void *)__pyx_v_aligned_p);
9341  goto __pyx_L0;
9342 
9343  /* "View.MemoryView":298
9344  *
9345  * @cname('__pyx_align_pointer')
9346  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
9347  * "Align pointer memory on a given boundary"
9348  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
9349  */
9350 
9351  /* function exit code */
9352  __pyx_L1_error:;
9353  __Pyx_WriteUnraisable("View.MemoryView.align_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
9354  __pyx_r = 0;
9355  __pyx_L0:;
9356  __Pyx_TraceReturn(Py_None, 1);
9357  return __pyx_r;
9358 }
9359 
9360 /* "View.MemoryView":345
9361  * cdef __Pyx_TypeInfo *typeinfo
9362  *
9363  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9364  * self.obj = obj
9365  * self.flags = flags
9366  */
9367 
9368 /* Python wrapper */
9369 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9370 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9371  PyObject *__pyx_v_obj = 0;
9372  int __pyx_v_flags;
9373  int __pyx_v_dtype_is_object;
9374  int __pyx_lineno = 0;
9375  const char *__pyx_filename = NULL;
9376  int __pyx_clineno = 0;
9377  int __pyx_r;
9378  __Pyx_RefNannyDeclarations
9379  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
9380  {
9381  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
9382  PyObject* values[3] = {0,0,0};
9383  if (unlikely(__pyx_kwds)) {
9384  Py_ssize_t kw_args;
9385  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9386  switch (pos_args) {
9387  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9388  CYTHON_FALLTHROUGH;
9389  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9390  CYTHON_FALLTHROUGH;
9391  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9392  CYTHON_FALLTHROUGH;
9393  case 0: break;
9394  default: goto __pyx_L5_argtuple_error;
9395  }
9396  kw_args = PyDict_Size(__pyx_kwds);
9397  switch (pos_args) {
9398  case 0:
9399  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
9400  else goto __pyx_L5_argtuple_error;
9401  CYTHON_FALLTHROUGH;
9402  case 1:
9403  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
9404  else {
9405  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(1, 345, __pyx_L3_error)
9406  }
9407  CYTHON_FALLTHROUGH;
9408  case 2:
9409  if (kw_args > 0) {
9410  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
9411  if (value) { values[2] = value; kw_args--; }
9412  }
9413  }
9414  if (unlikely(kw_args > 0)) {
9415  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(1, 345, __pyx_L3_error)
9416  }
9417  } else {
9418  switch (PyTuple_GET_SIZE(__pyx_args)) {
9419  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9420  CYTHON_FALLTHROUGH;
9421  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9422  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9423  break;
9424  default: goto __pyx_L5_argtuple_error;
9425  }
9426  }
9427  __pyx_v_obj = values[0];
9428  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9429  if (values[2]) {
9430  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 345, __pyx_L3_error)
9431  } else {
9432  __pyx_v_dtype_is_object = ((int)0);
9433  }
9434  }
9435  goto __pyx_L4_argument_unpacking_done;
9436  __pyx_L5_argtuple_error:;
9437  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 345, __pyx_L3_error)
9438  __pyx_L3_error:;
9439  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9440  __Pyx_RefNannyFinishContext();
9441  return -1;
9442  __pyx_L4_argument_unpacking_done:;
9443  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
9444 
9445  /* function exit code */
9446  __Pyx_RefNannyFinishContext();
9447  return __pyx_r;
9448 }
9449 
9450 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
9451  int __pyx_r;
9452  __Pyx_TraceDeclarations
9453  __Pyx_RefNannyDeclarations
9454  int __pyx_t_1;
9455  int __pyx_t_2;
9456  int __pyx_t_3;
9457  int __pyx_t_4;
9458  int __pyx_lineno = 0;
9459  const char *__pyx_filename = NULL;
9460  int __pyx_clineno = 0;
9461  __Pyx_RefNannySetupContext("__cinit__", 0);
9462  __Pyx_TraceCall("__cinit__", __pyx_f[1], 345, 0, __PYX_ERR(1, 345, __pyx_L1_error));
9463 
9464  /* "View.MemoryView":346
9465  *
9466  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9467  * self.obj = obj # <<<<<<<<<<<<<<
9468  * self.flags = flags
9469  * if type(self) is memoryview or obj is not None:
9470  */
9471  __Pyx_TraceLine(346,0,__PYX_ERR(1, 346, __pyx_L1_error))
9472  __Pyx_INCREF(__pyx_v_obj);
9473  __Pyx_GIVEREF(__pyx_v_obj);
9474  __Pyx_GOTREF(__pyx_v_self->obj);
9475  __Pyx_DECREF(__pyx_v_self->obj);
9476  __pyx_v_self->obj = __pyx_v_obj;
9477 
9478  /* "View.MemoryView":347
9479  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
9480  * self.obj = obj
9481  * self.flags = flags # <<<<<<<<<<<<<<
9482  * if type(self) is memoryview or obj is not None:
9483  * __Pyx_GetBuffer(obj, &self.view, flags)
9484  */
9485  __Pyx_TraceLine(347,0,__PYX_ERR(1, 347, __pyx_L1_error))
9486  __pyx_v_self->flags = __pyx_v_flags;
9487 
9488  /* "View.MemoryView":348
9489  * self.obj = obj
9490  * self.flags = flags
9491  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9492  * __Pyx_GetBuffer(obj, &self.view, flags)
9493  * if <PyObject *> self.view.obj == NULL:
9494  */
9495  __Pyx_TraceLine(348,0,__PYX_ERR(1, 348, __pyx_L1_error))
9496  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
9497  __pyx_t_3 = (__pyx_t_2 != 0);
9498  if (!__pyx_t_3) {
9499  } else {
9500  __pyx_t_1 = __pyx_t_3;
9501  goto __pyx_L4_bool_binop_done;
9502  }
9503  __pyx_t_3 = (__pyx_v_obj != Py_None);
9504  __pyx_t_2 = (__pyx_t_3 != 0);
9505  __pyx_t_1 = __pyx_t_2;
9506  __pyx_L4_bool_binop_done:;
9507  if (__pyx_t_1) {
9508 
9509  /* "View.MemoryView":349
9510  * self.flags = flags
9511  * if type(self) is memoryview or obj is not None:
9512  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
9513  * if <PyObject *> self.view.obj == NULL:
9514  * (<__pyx_buffer *> &self.view).obj = Py_None
9515  */
9516  __Pyx_TraceLine(349,0,__PYX_ERR(1, 349, __pyx_L1_error))
9517  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 349, __pyx_L1_error)
9518 
9519  /* "View.MemoryView":350
9520  * if type(self) is memoryview or obj is not None:
9521  * __Pyx_GetBuffer(obj, &self.view, flags)
9522  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9523  * (<__pyx_buffer *> &self.view).obj = Py_None
9524  * Py_INCREF(Py_None)
9525  */
9526  __Pyx_TraceLine(350,0,__PYX_ERR(1, 350, __pyx_L1_error))
9527  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
9528  if (__pyx_t_1) {
9529 
9530  /* "View.MemoryView":351
9531  * __Pyx_GetBuffer(obj, &self.view, flags)
9532  * if <PyObject *> self.view.obj == NULL:
9533  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
9534  * Py_INCREF(Py_None)
9535  *
9536  */
9537  __Pyx_TraceLine(351,0,__PYX_ERR(1, 351, __pyx_L1_error))
9538  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
9539 
9540  /* "View.MemoryView":352
9541  * if <PyObject *> self.view.obj == NULL:
9542  * (<__pyx_buffer *> &self.view).obj = Py_None
9543  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
9544  *
9545  * global __pyx_memoryview_thread_locks_used
9546  */
9547  __Pyx_TraceLine(352,0,__PYX_ERR(1, 352, __pyx_L1_error))
9548  Py_INCREF(Py_None);
9549 
9550  /* "View.MemoryView":350
9551  * if type(self) is memoryview or obj is not None:
9552  * __Pyx_GetBuffer(obj, &self.view, flags)
9553  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
9554  * (<__pyx_buffer *> &self.view).obj = Py_None
9555  * Py_INCREF(Py_None)
9556  */
9557  }
9558 
9559  /* "View.MemoryView":348
9560  * self.obj = obj
9561  * self.flags = flags
9562  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
9563  * __Pyx_GetBuffer(obj, &self.view, flags)
9564  * if <PyObject *> self.view.obj == NULL:
9565  */
9566  }
9567 
9568  /* "View.MemoryView":355
9569  *
9570  * global __pyx_memoryview_thread_locks_used
9571  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9572  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9573  * __pyx_memoryview_thread_locks_used += 1
9574  */
9575  __Pyx_TraceLine(355,0,__PYX_ERR(1, 355, __pyx_L1_error))
9576  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
9577  if (__pyx_t_1) {
9578 
9579  /* "View.MemoryView":356
9580  * global __pyx_memoryview_thread_locks_used
9581  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9582  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
9583  * __pyx_memoryview_thread_locks_used += 1
9584  * if self.lock is NULL:
9585  */
9586  __Pyx_TraceLine(356,0,__PYX_ERR(1, 356, __pyx_L1_error))
9587  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9588 
9589  /* "View.MemoryView":357
9590  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
9591  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9592  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
9593  * if self.lock is NULL:
9594  * self.lock = PyThread_allocate_lock()
9595  */
9596  __Pyx_TraceLine(357,0,__PYX_ERR(1, 357, __pyx_L1_error))
9597  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
9598 
9599  /* "View.MemoryView":355
9600  *
9601  * global __pyx_memoryview_thread_locks_used
9602  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
9603  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9604  * __pyx_memoryview_thread_locks_used += 1
9605  */
9606  }
9607 
9608  /* "View.MemoryView":358
9609  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9610  * __pyx_memoryview_thread_locks_used += 1
9611  * if self.lock is NULL: # <<<<<<<<<<<<<<
9612  * self.lock = PyThread_allocate_lock()
9613  * if self.lock is NULL:
9614  */
9615  __Pyx_TraceLine(358,0,__PYX_ERR(1, 358, __pyx_L1_error))
9616  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9617  if (__pyx_t_1) {
9618 
9619  /* "View.MemoryView":359
9620  * __pyx_memoryview_thread_locks_used += 1
9621  * if self.lock is NULL:
9622  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
9623  * if self.lock is NULL:
9624  * raise MemoryError
9625  */
9626  __Pyx_TraceLine(359,0,__PYX_ERR(1, 359, __pyx_L1_error))
9627  __pyx_v_self->lock = PyThread_allocate_lock();
9628 
9629  /* "View.MemoryView":360
9630  * if self.lock is NULL:
9631  * self.lock = PyThread_allocate_lock()
9632  * if self.lock is NULL: # <<<<<<<<<<<<<<
9633  * raise MemoryError
9634  *
9635  */
9636  __Pyx_TraceLine(360,0,__PYX_ERR(1, 360, __pyx_L1_error))
9637  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
9638  if (unlikely(__pyx_t_1)) {
9639 
9640  /* "View.MemoryView":361
9641  * self.lock = PyThread_allocate_lock()
9642  * if self.lock is NULL:
9643  * raise MemoryError # <<<<<<<<<<<<<<
9644  *
9645  * if flags & PyBUF_FORMAT:
9646  */
9647  __Pyx_TraceLine(361,0,__PYX_ERR(1, 361, __pyx_L1_error))
9648  PyErr_NoMemory(); __PYX_ERR(1, 361, __pyx_L1_error)
9649 
9650  /* "View.MemoryView":360
9651  * if self.lock is NULL:
9652  * self.lock = PyThread_allocate_lock()
9653  * if self.lock is NULL: # <<<<<<<<<<<<<<
9654  * raise MemoryError
9655  *
9656  */
9657  }
9658 
9659  /* "View.MemoryView":358
9660  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
9661  * __pyx_memoryview_thread_locks_used += 1
9662  * if self.lock is NULL: # <<<<<<<<<<<<<<
9663  * self.lock = PyThread_allocate_lock()
9664  * if self.lock is NULL:
9665  */
9666  }
9667 
9668  /* "View.MemoryView":363
9669  * raise MemoryError
9670  *
9671  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9672  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9673  * else:
9674  */
9675  __Pyx_TraceLine(363,0,__PYX_ERR(1, 363, __pyx_L1_error))
9676  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
9677  if (__pyx_t_1) {
9678 
9679  /* "View.MemoryView":364
9680  *
9681  * if flags & PyBUF_FORMAT:
9682  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
9683  * else:
9684  * self.dtype_is_object = dtype_is_object
9685  */
9686  __Pyx_TraceLine(364,0,__PYX_ERR(1, 364, __pyx_L1_error))
9687  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
9688  if (__pyx_t_2) {
9689  } else {
9690  __pyx_t_1 = __pyx_t_2;
9691  goto __pyx_L11_bool_binop_done;
9692  }
9693  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
9694  __pyx_t_1 = __pyx_t_2;
9695  __pyx_L11_bool_binop_done:;
9696  __pyx_v_self->dtype_is_object = __pyx_t_1;
9697 
9698  /* "View.MemoryView":363
9699  * raise MemoryError
9700  *
9701  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
9702  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9703  * else:
9704  */
9705  goto __pyx_L10;
9706  }
9707 
9708  /* "View.MemoryView":366
9709  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
9710  * else:
9711  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
9712  *
9713  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9714  */
9715  __Pyx_TraceLine(366,0,__PYX_ERR(1, 366, __pyx_L1_error))
9716  /*else*/ {
9717  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
9718  }
9719  __pyx_L10:;
9720 
9721  /* "View.MemoryView":368
9722  * self.dtype_is_object = dtype_is_object
9723  *
9724  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
9725  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9726  * self.typeinfo = NULL
9727  */
9728  __Pyx_TraceLine(368,0,__PYX_ERR(1, 368, __pyx_L1_error))
9729  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
9730 
9731  /* "View.MemoryView":370
9732  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
9733  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
9734  * self.typeinfo = NULL # <<<<<<<<<<<<<<
9735  *
9736  * def __dealloc__(memoryview self):
9737  */
9738  __Pyx_TraceLine(370,0,__PYX_ERR(1, 370, __pyx_L1_error))
9739  __pyx_v_self->typeinfo = NULL;
9740 
9741  /* "View.MemoryView":345
9742  * cdef __Pyx_TypeInfo *typeinfo
9743  *
9744  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
9745  * self.obj = obj
9746  * self.flags = flags
9747  */
9748 
9749  /* function exit code */
9750  __pyx_r = 0;
9751  goto __pyx_L0;
9752  __pyx_L1_error:;
9753  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9754  __pyx_r = -1;
9755  __pyx_L0:;
9756  __Pyx_TraceReturn(Py_None, 0);
9757  __Pyx_RefNannyFinishContext();
9758  return __pyx_r;
9759 }
9760 
9761 /* "View.MemoryView":372
9762  * self.typeinfo = NULL
9763  *
9764  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
9765  * if self.obj is not None:
9766  * __Pyx_ReleaseBuffer(&self.view)
9767  */
9768 
9769 /* Python wrapper */
9770 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
9771 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
9772  __Pyx_RefNannyDeclarations
9773  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
9774  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
9775 
9776  /* function exit code */
9777  __Pyx_RefNannyFinishContext();
9778 }
9779 
9780 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
9781  int __pyx_v_i;
9782  __Pyx_TraceDeclarations
9783  __Pyx_RefNannyDeclarations
9784  int __pyx_t_1;
9785  int __pyx_t_2;
9786  int __pyx_t_3;
9787  int __pyx_t_4;
9788  int __pyx_t_5;
9789  PyThread_type_lock __pyx_t_6;
9790  PyThread_type_lock __pyx_t_7;
9791  int __pyx_lineno = 0;
9792  const char *__pyx_filename = NULL;
9793  int __pyx_clineno = 0;
9794  __Pyx_RefNannySetupContext("__dealloc__", 0);
9795  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 372, 0, __PYX_ERR(1, 372, __pyx_L1_error));
9796 
9797  /* "View.MemoryView":373
9798  *
9799  * def __dealloc__(memoryview self):
9800  * if self.obj is not None: # <<<<<<<<<<<<<<
9801  * __Pyx_ReleaseBuffer(&self.view)
9802  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9803  */
9804  __Pyx_TraceLine(373,0,__PYX_ERR(1, 373, __pyx_L1_error))
9805  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
9806  __pyx_t_2 = (__pyx_t_1 != 0);
9807  if (__pyx_t_2) {
9808 
9809  /* "View.MemoryView":374
9810  * def __dealloc__(memoryview self):
9811  * if self.obj is not None:
9812  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
9813  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9814  *
9815  */
9816  __Pyx_TraceLine(374,0,__PYX_ERR(1, 374, __pyx_L1_error))
9817  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
9818 
9819  /* "View.MemoryView":373
9820  *
9821  * def __dealloc__(memoryview self):
9822  * if self.obj is not None: # <<<<<<<<<<<<<<
9823  * __Pyx_ReleaseBuffer(&self.view)
9824  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9825  */
9826  goto __pyx_L3;
9827  }
9828 
9829  /* "View.MemoryView":375
9830  * if self.obj is not None:
9831  * __Pyx_ReleaseBuffer(&self.view)
9832  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9833  *
9834  * (<__pyx_buffer *> &self.view).obj = NULL
9835  */
9836  __Pyx_TraceLine(375,0,__PYX_ERR(1, 375, __pyx_L1_error))
9837  __pyx_t_2 = ((((Py_buffer *)(&__pyx_v_self->view))->obj == Py_None) != 0);
9838  if (__pyx_t_2) {
9839 
9840  /* "View.MemoryView":377
9841  * elif (<__pyx_buffer *> &self.view).obj == Py_None:
9842  *
9843  * (<__pyx_buffer *> &self.view).obj = NULL # <<<<<<<<<<<<<<
9844  * Py_DECREF(Py_None)
9845  *
9846  */
9847  __Pyx_TraceLine(377,0,__PYX_ERR(1, 377, __pyx_L1_error))
9848  ((Py_buffer *)(&__pyx_v_self->view))->obj = NULL;
9849 
9850  /* "View.MemoryView":378
9851  *
9852  * (<__pyx_buffer *> &self.view).obj = NULL
9853  * Py_DECREF(Py_None) # <<<<<<<<<<<<<<
9854  *
9855  * cdef int i
9856  */
9857  __Pyx_TraceLine(378,0,__PYX_ERR(1, 378, __pyx_L1_error))
9858  Py_DECREF(Py_None);
9859 
9860  /* "View.MemoryView":375
9861  * if self.obj is not None:
9862  * __Pyx_ReleaseBuffer(&self.view)
9863  * elif (<__pyx_buffer *> &self.view).obj == Py_None: # <<<<<<<<<<<<<<
9864  *
9865  * (<__pyx_buffer *> &self.view).obj = NULL
9866  */
9867  }
9868  __pyx_L3:;
9869 
9870  /* "View.MemoryView":382
9871  * cdef int i
9872  * global __pyx_memoryview_thread_locks_used
9873  * if self.lock != NULL: # <<<<<<<<<<<<<<
9874  * for i in range(__pyx_memoryview_thread_locks_used):
9875  * if __pyx_memoryview_thread_locks[i] is self.lock:
9876  */
9877  __Pyx_TraceLine(382,0,__PYX_ERR(1, 382, __pyx_L1_error))
9878  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
9879  if (__pyx_t_2) {
9880 
9881  /* "View.MemoryView":383
9882  * global __pyx_memoryview_thread_locks_used
9883  * if self.lock != NULL:
9884  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
9885  * if __pyx_memoryview_thread_locks[i] is self.lock:
9886  * __pyx_memoryview_thread_locks_used -= 1
9887  */
9888  __Pyx_TraceLine(383,0,__PYX_ERR(1, 383, __pyx_L1_error))
9889  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
9890  __pyx_t_4 = __pyx_t_3;
9891  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
9892  __pyx_v_i = __pyx_t_5;
9893 
9894  /* "View.MemoryView":384
9895  * if self.lock != NULL:
9896  * for i in range(__pyx_memoryview_thread_locks_used):
9897  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9898  * __pyx_memoryview_thread_locks_used -= 1
9899  * if i != __pyx_memoryview_thread_locks_used:
9900  */
9901  __Pyx_TraceLine(384,0,__PYX_ERR(1, 384, __pyx_L1_error))
9902  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
9903  if (__pyx_t_2) {
9904 
9905  /* "View.MemoryView":385
9906  * for i in range(__pyx_memoryview_thread_locks_used):
9907  * if __pyx_memoryview_thread_locks[i] is self.lock:
9908  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
9909  * if i != __pyx_memoryview_thread_locks_used:
9910  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9911  */
9912  __Pyx_TraceLine(385,0,__PYX_ERR(1, 385, __pyx_L1_error))
9913  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
9914 
9915  /* "View.MemoryView":386
9916  * if __pyx_memoryview_thread_locks[i] is self.lock:
9917  * __pyx_memoryview_thread_locks_used -= 1
9918  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9919  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9920  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9921  */
9922  __Pyx_TraceLine(386,0,__PYX_ERR(1, 386, __pyx_L1_error))
9923  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
9924  if (__pyx_t_2) {
9925 
9926  /* "View.MemoryView":388
9927  * if i != __pyx_memoryview_thread_locks_used:
9928  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9929  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
9930  * break
9931  * else:
9932  */
9933  __Pyx_TraceLine(388,0,__PYX_ERR(1, 388, __pyx_L1_error))
9934  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
9935  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
9936 
9937  /* "View.MemoryView":387
9938  * __pyx_memoryview_thread_locks_used -= 1
9939  * if i != __pyx_memoryview_thread_locks_used:
9940  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
9941  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9942  * break
9943  */
9944  __Pyx_TraceLine(387,0,__PYX_ERR(1, 387, __pyx_L1_error))
9945  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
9946  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
9947 
9948  /* "View.MemoryView":386
9949  * if __pyx_memoryview_thread_locks[i] is self.lock:
9950  * __pyx_memoryview_thread_locks_used -= 1
9951  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
9952  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9953  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9954  */
9955  }
9956 
9957  /* "View.MemoryView":389
9958  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
9959  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
9960  * break # <<<<<<<<<<<<<<
9961  * else:
9962  * PyThread_free_lock(self.lock)
9963  */
9964  __Pyx_TraceLine(389,0,__PYX_ERR(1, 389, __pyx_L1_error))
9965  goto __pyx_L6_break;
9966 
9967  /* "View.MemoryView":384
9968  * if self.lock != NULL:
9969  * for i in range(__pyx_memoryview_thread_locks_used):
9970  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
9971  * __pyx_memoryview_thread_locks_used -= 1
9972  * if i != __pyx_memoryview_thread_locks_used:
9973  */
9974  }
9975  }
9976  /*else*/ {
9977 
9978  /* "View.MemoryView":391
9979  * break
9980  * else:
9981  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
9982  *
9983  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
9984  */
9985  __Pyx_TraceLine(391,0,__PYX_ERR(1, 391, __pyx_L1_error))
9986  PyThread_free_lock(__pyx_v_self->lock);
9987  }
9988  __pyx_L6_break:;
9989 
9990  /* "View.MemoryView":382
9991  * cdef int i
9992  * global __pyx_memoryview_thread_locks_used
9993  * if self.lock != NULL: # <<<<<<<<<<<<<<
9994  * for i in range(__pyx_memoryview_thread_locks_used):
9995  * if __pyx_memoryview_thread_locks[i] is self.lock:
9996  */
9997  }
9998 
9999  /* "View.MemoryView":372
10000  * self.typeinfo = NULL
10001  *
10002  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10003  * if self.obj is not None:
10004  * __Pyx_ReleaseBuffer(&self.view)
10005  */
10006 
10007  /* function exit code */
10008  goto __pyx_L0;
10009  __pyx_L1_error:;
10010  __Pyx_WriteUnraisable("View.MemoryView.memoryview.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
10011  __pyx_L0:;
10012  __Pyx_TraceReturn(Py_None, 0);
10013  __Pyx_RefNannyFinishContext();
10014 }
10015 
10016 /* "View.MemoryView":393
10017  * PyThread_free_lock(self.lock)
10018  *
10019  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10020  * cdef Py_ssize_t dim
10021  * cdef char *itemp = <char *> self.view.buf
10022  */
10023 
10024 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10025  Py_ssize_t __pyx_v_dim;
10026  char *__pyx_v_itemp;
10027  PyObject *__pyx_v_idx = NULL;
10028  char *__pyx_r;
10029  __Pyx_TraceDeclarations
10030  __Pyx_RefNannyDeclarations
10031  Py_ssize_t __pyx_t_1;
10032  PyObject *__pyx_t_2 = NULL;
10033  Py_ssize_t __pyx_t_3;
10034  PyObject *(*__pyx_t_4)(PyObject *);
10035  PyObject *__pyx_t_5 = NULL;
10036  Py_ssize_t __pyx_t_6;
10037  char *__pyx_t_7;
10038  int __pyx_lineno = 0;
10039  const char *__pyx_filename = NULL;
10040  int __pyx_clineno = 0;
10041  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10042  __Pyx_TraceCall("get_item_pointer", __pyx_f[1], 393, 0, __PYX_ERR(1, 393, __pyx_L1_error));
10043 
10044  /* "View.MemoryView":395
10045  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10046  * cdef Py_ssize_t dim
10047  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10048  *
10049  * for dim, idx in enumerate(index):
10050  */
10051  __Pyx_TraceLine(395,0,__PYX_ERR(1, 395, __pyx_L1_error))
10052  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10053 
10054  /* "View.MemoryView":397
10055  * cdef char *itemp = <char *> self.view.buf
10056  *
10057  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10058  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10059  *
10060  */
10061  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10062  __pyx_t_1 = 0;
10063  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10064  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10065  __pyx_t_4 = NULL;
10066  } else {
10067  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 397, __pyx_L1_error)
10068  __Pyx_GOTREF(__pyx_t_2);
10069  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 397, __pyx_L1_error)
10070  }
10071  for (;;) {
10072  if (likely(!__pyx_t_4)) {
10073  if (likely(PyList_CheckExact(__pyx_t_2))) {
10074  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10075  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10076  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10077  #else
10078  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10079  __Pyx_GOTREF(__pyx_t_5);
10080  #endif
10081  } else {
10082  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10083  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10084  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(1, 397, __pyx_L1_error)
10085  #else
10086  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 397, __pyx_L1_error)
10087  __Pyx_GOTREF(__pyx_t_5);
10088  #endif
10089  }
10090  } else {
10091  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10092  if (unlikely(!__pyx_t_5)) {
10093  PyObject* exc_type = PyErr_Occurred();
10094  if (exc_type) {
10095  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10096  else __PYX_ERR(1, 397, __pyx_L1_error)
10097  }
10098  break;
10099  }
10100  __Pyx_GOTREF(__pyx_t_5);
10101  }
10102  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10103  __pyx_t_5 = 0;
10104  __pyx_v_dim = __pyx_t_1;
10105  __pyx_t_1 = (__pyx_t_1 + 1);
10106 
10107  /* "View.MemoryView":398
10108  *
10109  * for dim, idx in enumerate(index):
10110  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10111  *
10112  * return itemp
10113  */
10114  __Pyx_TraceLine(398,0,__PYX_ERR(1, 398, __pyx_L1_error))
10115  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 398, __pyx_L1_error)
10116  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(1, 398, __pyx_L1_error)
10117  __pyx_v_itemp = __pyx_t_7;
10118 
10119  /* "View.MemoryView":397
10120  * cdef char *itemp = <char *> self.view.buf
10121  *
10122  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10123  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10124  *
10125  */
10126  __Pyx_TraceLine(397,0,__PYX_ERR(1, 397, __pyx_L1_error))
10127  }
10128  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10129 
10130  /* "View.MemoryView":400
10131  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10132  *
10133  * return itemp # <<<<<<<<<<<<<<
10134  *
10135  *
10136  */
10137  __Pyx_TraceLine(400,0,__PYX_ERR(1, 400, __pyx_L1_error))
10138  __pyx_r = __pyx_v_itemp;
10139  goto __pyx_L0;
10140 
10141  /* "View.MemoryView":393
10142  * PyThread_free_lock(self.lock)
10143  *
10144  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10145  * cdef Py_ssize_t dim
10146  * cdef char *itemp = <char *> self.view.buf
10147  */
10148 
10149  /* function exit code */
10150  __pyx_L1_error:;
10151  __Pyx_XDECREF(__pyx_t_2);
10152  __Pyx_XDECREF(__pyx_t_5);
10153  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10154  __pyx_r = NULL;
10155  __pyx_L0:;
10156  __Pyx_XDECREF(__pyx_v_idx);
10157  __Pyx_TraceReturn(Py_None, 0);
10158  __Pyx_RefNannyFinishContext();
10159  return __pyx_r;
10160 }
10161 
10162 /* "View.MemoryView":403
10163  *
10164  *
10165  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10166  * if index is Ellipsis:
10167  * return self
10168  */
10169 
10170 /* Python wrapper */
10171 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10172 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10173  PyObject *__pyx_r = 0;
10174  __Pyx_RefNannyDeclarations
10175  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10176  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10177 
10178  /* function exit code */
10179  __Pyx_RefNannyFinishContext();
10180  return __pyx_r;
10181 }
10182 
10183 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10184  PyObject *__pyx_v_have_slices = NULL;
10185  PyObject *__pyx_v_indices = NULL;
10186  char *__pyx_v_itemp;
10187  PyObject *__pyx_r = NULL;
10188  __Pyx_TraceDeclarations
10189  __Pyx_RefNannyDeclarations
10190  int __pyx_t_1;
10191  int __pyx_t_2;
10192  PyObject *__pyx_t_3 = NULL;
10193  PyObject *__pyx_t_4 = NULL;
10194  PyObject *__pyx_t_5 = NULL;
10195  char *__pyx_t_6;
10196  int __pyx_lineno = 0;
10197  const char *__pyx_filename = NULL;
10198  int __pyx_clineno = 0;
10199  __Pyx_RefNannySetupContext("__getitem__", 0);
10200  __Pyx_TraceCall("__getitem__", __pyx_f[1], 403, 0, __PYX_ERR(1, 403, __pyx_L1_error));
10201 
10202  /* "View.MemoryView":404
10203  *
10204  * def __getitem__(memoryview self, object index):
10205  * if index is Ellipsis: # <<<<<<<<<<<<<<
10206  * return self
10207  *
10208  */
10209  __Pyx_TraceLine(404,0,__PYX_ERR(1, 404, __pyx_L1_error))
10210  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10211  __pyx_t_2 = (__pyx_t_1 != 0);
10212  if (__pyx_t_2) {
10213 
10214  /* "View.MemoryView":405
10215  * def __getitem__(memoryview self, object index):
10216  * if index is Ellipsis:
10217  * return self # <<<<<<<<<<<<<<
10218  *
10219  * have_slices, indices = _unellipsify(index, self.view.ndim)
10220  */
10221  __Pyx_TraceLine(405,0,__PYX_ERR(1, 405, __pyx_L1_error))
10222  __Pyx_XDECREF(__pyx_r);
10223  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10224  __pyx_r = ((PyObject *)__pyx_v_self);
10225  goto __pyx_L0;
10226 
10227  /* "View.MemoryView":404
10228  *
10229  * def __getitem__(memoryview self, object index):
10230  * if index is Ellipsis: # <<<<<<<<<<<<<<
10231  * return self
10232  *
10233  */
10234  }
10235 
10236  /* "View.MemoryView":407
10237  * return self
10238  *
10239  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10240  *
10241  * cdef char *itemp
10242  */
10243  __Pyx_TraceLine(407,0,__PYX_ERR(1, 407, __pyx_L1_error))
10244  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 407, __pyx_L1_error)
10245  __Pyx_GOTREF(__pyx_t_3);
10246  if (likely(__pyx_t_3 != Py_None)) {
10247  PyObject* sequence = __pyx_t_3;
10248  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10249  if (unlikely(size != 2)) {
10250  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10251  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10252  __PYX_ERR(1, 407, __pyx_L1_error)
10253  }
10254  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10255  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10256  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10257  __Pyx_INCREF(__pyx_t_4);
10258  __Pyx_INCREF(__pyx_t_5);
10259  #else
10260  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 407, __pyx_L1_error)
10261  __Pyx_GOTREF(__pyx_t_4);
10262  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 407, __pyx_L1_error)
10263  __Pyx_GOTREF(__pyx_t_5);
10264  #endif
10265  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10266  } else {
10267  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 407, __pyx_L1_error)
10268  }
10269  __pyx_v_have_slices = __pyx_t_4;
10270  __pyx_t_4 = 0;
10271  __pyx_v_indices = __pyx_t_5;
10272  __pyx_t_5 = 0;
10273 
10274  /* "View.MemoryView":410
10275  *
10276  * cdef char *itemp
10277  * if have_slices: # <<<<<<<<<<<<<<
10278  * return memview_slice(self, indices)
10279  * else:
10280  */
10281  __Pyx_TraceLine(410,0,__PYX_ERR(1, 410, __pyx_L1_error))
10282  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(1, 410, __pyx_L1_error)
10283  if (__pyx_t_2) {
10284 
10285  /* "View.MemoryView":411
10286  * cdef char *itemp
10287  * if have_slices:
10288  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
10289  * else:
10290  * itemp = self.get_item_pointer(indices)
10291  */
10292  __Pyx_TraceLine(411,0,__PYX_ERR(1, 411, __pyx_L1_error))
10293  __Pyx_XDECREF(__pyx_r);
10294  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 411, __pyx_L1_error)
10295  __Pyx_GOTREF(__pyx_t_3);
10296  __pyx_r = __pyx_t_3;
10297  __pyx_t_3 = 0;
10298  goto __pyx_L0;
10299 
10300  /* "View.MemoryView":410
10301  *
10302  * cdef char *itemp
10303  * if have_slices: # <<<<<<<<<<<<<<
10304  * return memview_slice(self, indices)
10305  * else:
10306  */
10307  }
10308 
10309  /* "View.MemoryView":413
10310  * return memview_slice(self, indices)
10311  * else:
10312  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
10313  * return self.convert_item_to_object(itemp)
10314  *
10315  */
10316  __Pyx_TraceLine(413,0,__PYX_ERR(1, 413, __pyx_L1_error))
10317  /*else*/ {
10318  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(1, 413, __pyx_L1_error)
10319  __pyx_v_itemp = __pyx_t_6;
10320 
10321  /* "View.MemoryView":414
10322  * else:
10323  * itemp = self.get_item_pointer(indices)
10324  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
10325  *
10326  * def __setitem__(memoryview self, object index, object value):
10327  */
10328  __Pyx_TraceLine(414,0,__PYX_ERR(1, 414, __pyx_L1_error))
10329  __Pyx_XDECREF(__pyx_r);
10330  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 414, __pyx_L1_error)
10331  __Pyx_GOTREF(__pyx_t_3);
10332  __pyx_r = __pyx_t_3;
10333  __pyx_t_3 = 0;
10334  goto __pyx_L0;
10335  }
10336 
10337  /* "View.MemoryView":403
10338  *
10339  *
10340  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10341  * if index is Ellipsis:
10342  * return self
10343  */
10344 
10345  /* function exit code */
10346  __pyx_L1_error:;
10347  __Pyx_XDECREF(__pyx_t_3);
10348  __Pyx_XDECREF(__pyx_t_4);
10349  __Pyx_XDECREF(__pyx_t_5);
10350  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10351  __pyx_r = NULL;
10352  __pyx_L0:;
10353  __Pyx_XDECREF(__pyx_v_have_slices);
10354  __Pyx_XDECREF(__pyx_v_indices);
10355  __Pyx_XGIVEREF(__pyx_r);
10356  __Pyx_TraceReturn(__pyx_r, 0);
10357  __Pyx_RefNannyFinishContext();
10358  return __pyx_r;
10359 }
10360 
10361 /* "View.MemoryView":416
10362  * return self.convert_item_to_object(itemp)
10363  *
10364  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10365  * if self.view.readonly:
10366  * raise TypeError("Cannot assign to read-only memoryview")
10367  */
10368 
10369 /* Python wrapper */
10370 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
10371 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10372  int __pyx_r;
10373  __Pyx_RefNannyDeclarations
10374  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
10375  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
10376 
10377  /* function exit code */
10378  __Pyx_RefNannyFinishContext();
10379  return __pyx_r;
10380 }
10381 
10382 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
10383  PyObject *__pyx_v_have_slices = NULL;
10384  PyObject *__pyx_v_obj = NULL;
10385  int __pyx_r;
10386  __Pyx_TraceDeclarations
10387  __Pyx_RefNannyDeclarations
10388  int __pyx_t_1;
10389  PyObject *__pyx_t_2 = NULL;
10390  PyObject *__pyx_t_3 = NULL;
10391  PyObject *__pyx_t_4 = NULL;
10392  int __pyx_lineno = 0;
10393  const char *__pyx_filename = NULL;
10394  int __pyx_clineno = 0;
10395  __Pyx_RefNannySetupContext("__setitem__", 0);
10396  __Pyx_TraceCall("__setitem__", __pyx_f[1], 416, 0, __PYX_ERR(1, 416, __pyx_L1_error));
10397  __Pyx_INCREF(__pyx_v_index);
10398 
10399  /* "View.MemoryView":417
10400  *
10401  * def __setitem__(memoryview self, object index, object value):
10402  * if self.view.readonly: # <<<<<<<<<<<<<<
10403  * raise TypeError("Cannot assign to read-only memoryview")
10404  *
10405  */
10406  __Pyx_TraceLine(417,0,__PYX_ERR(1, 417, __pyx_L1_error))
10407  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
10408  if (unlikely(__pyx_t_1)) {
10409 
10410  /* "View.MemoryView":418
10411  * def __setitem__(memoryview self, object index, object value):
10412  * if self.view.readonly:
10413  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
10414  *
10415  * have_slices, index = _unellipsify(index, self.view.ndim)
10416  */
10417  __Pyx_TraceLine(418,0,__PYX_ERR(1, 418, __pyx_L1_error))
10418  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 418, __pyx_L1_error)
10419  __Pyx_GOTREF(__pyx_t_2);
10420  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
10421  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10422  __PYX_ERR(1, 418, __pyx_L1_error)
10423 
10424  /* "View.MemoryView":417
10425  *
10426  * def __setitem__(memoryview self, object index, object value):
10427  * if self.view.readonly: # <<<<<<<<<<<<<<
10428  * raise TypeError("Cannot assign to read-only memoryview")
10429  *
10430  */
10431  }
10432 
10433  /* "View.MemoryView":420
10434  * raise TypeError("Cannot assign to read-only memoryview")
10435  *
10436  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10437  *
10438  * if have_slices:
10439  */
10440  __Pyx_TraceLine(420,0,__PYX_ERR(1, 420, __pyx_L1_error))
10441  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 420, __pyx_L1_error)
10442  __Pyx_GOTREF(__pyx_t_2);
10443  if (likely(__pyx_t_2 != Py_None)) {
10444  PyObject* sequence = __pyx_t_2;
10445  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10446  if (unlikely(size != 2)) {
10447  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10448  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10449  __PYX_ERR(1, 420, __pyx_L1_error)
10450  }
10451  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10452  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
10453  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
10454  __Pyx_INCREF(__pyx_t_3);
10455  __Pyx_INCREF(__pyx_t_4);
10456  #else
10457  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 420, __pyx_L1_error)
10458  __Pyx_GOTREF(__pyx_t_3);
10459  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 420, __pyx_L1_error)
10460  __Pyx_GOTREF(__pyx_t_4);
10461  #endif
10462  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10463  } else {
10464  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 420, __pyx_L1_error)
10465  }
10466  __pyx_v_have_slices = __pyx_t_3;
10467  __pyx_t_3 = 0;
10468  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
10469  __pyx_t_4 = 0;
10470 
10471  /* "View.MemoryView":422
10472  * have_slices, index = _unellipsify(index, self.view.ndim)
10473  *
10474  * if have_slices: # <<<<<<<<<<<<<<
10475  * obj = self.is_slice(value)
10476  * if obj:
10477  */
10478  __Pyx_TraceLine(422,0,__PYX_ERR(1, 422, __pyx_L1_error))
10479  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 422, __pyx_L1_error)
10480  if (__pyx_t_1) {
10481 
10482  /* "View.MemoryView":423
10483  *
10484  * if have_slices:
10485  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
10486  * if obj:
10487  * self.setitem_slice_assignment(self[index], obj)
10488  */
10489  __Pyx_TraceLine(423,0,__PYX_ERR(1, 423, __pyx_L1_error))
10490  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 423, __pyx_L1_error)
10491  __Pyx_GOTREF(__pyx_t_2);
10492  __pyx_v_obj = __pyx_t_2;
10493  __pyx_t_2 = 0;
10494 
10495  /* "View.MemoryView":424
10496  * if have_slices:
10497  * obj = self.is_slice(value)
10498  * if obj: # <<<<<<<<<<<<<<
10499  * self.setitem_slice_assignment(self[index], obj)
10500  * else:
10501  */
10502  __Pyx_TraceLine(424,0,__PYX_ERR(1, 424, __pyx_L1_error))
10503  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 424, __pyx_L1_error)
10504  if (__pyx_t_1) {
10505 
10506  /* "View.MemoryView":425
10507  * obj = self.is_slice(value)
10508  * if obj:
10509  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
10510  * else:
10511  * self.setitem_slice_assign_scalar(self[index], value)
10512  */
10513  __Pyx_TraceLine(425,0,__PYX_ERR(1, 425, __pyx_L1_error))
10514  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 425, __pyx_L1_error)
10515  __Pyx_GOTREF(__pyx_t_2);
10516  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 425, __pyx_L1_error)
10517  __Pyx_GOTREF(__pyx_t_4);
10518  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10519  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10520 
10521  /* "View.MemoryView":424
10522  * if have_slices:
10523  * obj = self.is_slice(value)
10524  * if obj: # <<<<<<<<<<<<<<
10525  * self.setitem_slice_assignment(self[index], obj)
10526  * else:
10527  */
10528  goto __pyx_L5;
10529  }
10530 
10531  /* "View.MemoryView":427
10532  * self.setitem_slice_assignment(self[index], obj)
10533  * else:
10534  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
10535  * else:
10536  * self.setitem_indexed(index, value)
10537  */
10538  __Pyx_TraceLine(427,0,__PYX_ERR(1, 427, __pyx_L1_error))
10539  /*else*/ {
10540  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 427, __pyx_L1_error)
10541  __Pyx_GOTREF(__pyx_t_4);
10542  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(1, 427, __pyx_L1_error)
10543  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 427, __pyx_L1_error)
10544  __Pyx_GOTREF(__pyx_t_2);
10545  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10546  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10547  }
10548  __pyx_L5:;
10549 
10550  /* "View.MemoryView":422
10551  * have_slices, index = _unellipsify(index, self.view.ndim)
10552  *
10553  * if have_slices: # <<<<<<<<<<<<<<
10554  * obj = self.is_slice(value)
10555  * if obj:
10556  */
10557  goto __pyx_L4;
10558  }
10559 
10560  /* "View.MemoryView":429
10561  * self.setitem_slice_assign_scalar(self[index], value)
10562  * else:
10563  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
10564  *
10565  * cdef is_slice(self, obj):
10566  */
10567  __Pyx_TraceLine(429,0,__PYX_ERR(1, 429, __pyx_L1_error))
10568  /*else*/ {
10569  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 429, __pyx_L1_error)
10570  __Pyx_GOTREF(__pyx_t_2);
10571  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10572  }
10573  __pyx_L4:;
10574 
10575  /* "View.MemoryView":416
10576  * return self.convert_item_to_object(itemp)
10577  *
10578  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
10579  * if self.view.readonly:
10580  * raise TypeError("Cannot assign to read-only memoryview")
10581  */
10582 
10583  /* function exit code */
10584  __pyx_r = 0;
10585  goto __pyx_L0;
10586  __pyx_L1_error:;
10587  __Pyx_XDECREF(__pyx_t_2);
10588  __Pyx_XDECREF(__pyx_t_3);
10589  __Pyx_XDECREF(__pyx_t_4);
10590  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10591  __pyx_r = -1;
10592  __pyx_L0:;
10593  __Pyx_XDECREF(__pyx_v_have_slices);
10594  __Pyx_XDECREF(__pyx_v_obj);
10595  __Pyx_XDECREF(__pyx_v_index);
10596  __Pyx_TraceReturn(Py_None, 0);
10597  __Pyx_RefNannyFinishContext();
10598  return __pyx_r;
10599 }
10600 
10601 /* "View.MemoryView":431
10602  * self.setitem_indexed(index, value)
10603  *
10604  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10605  * if not isinstance(obj, memoryview):
10606  * try:
10607  */
10608 
10609 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
10610  PyObject *__pyx_r = NULL;
10611  __Pyx_TraceDeclarations
10612  __Pyx_RefNannyDeclarations
10613  int __pyx_t_1;
10614  int __pyx_t_2;
10615  PyObject *__pyx_t_3 = NULL;
10616  PyObject *__pyx_t_4 = NULL;
10617  PyObject *__pyx_t_5 = NULL;
10618  PyObject *__pyx_t_6 = NULL;
10619  PyObject *__pyx_t_7 = NULL;
10620  PyObject *__pyx_t_8 = NULL;
10621  int __pyx_t_9;
10622  int __pyx_lineno = 0;
10623  const char *__pyx_filename = NULL;
10624  int __pyx_clineno = 0;
10625  __Pyx_RefNannySetupContext("is_slice", 0);
10626  __Pyx_TraceCall("is_slice", __pyx_f[1], 431, 0, __PYX_ERR(1, 431, __pyx_L1_error));
10627  __Pyx_INCREF(__pyx_v_obj);
10628 
10629  /* "View.MemoryView":432
10630  *
10631  * cdef is_slice(self, obj):
10632  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10633  * try:
10634  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10635  */
10636  __Pyx_TraceLine(432,0,__PYX_ERR(1, 432, __pyx_L1_error))
10637  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
10638  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
10639  if (__pyx_t_2) {
10640 
10641  /* "View.MemoryView":433
10642  * cdef is_slice(self, obj):
10643  * if not isinstance(obj, memoryview):
10644  * try: # <<<<<<<<<<<<<<
10645  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10646  * self.dtype_is_object)
10647  */
10648  __Pyx_TraceLine(433,0,__PYX_ERR(1, 433, __pyx_L1_error))
10649  {
10650  __Pyx_PyThreadState_declare
10651  __Pyx_PyThreadState_assign
10652  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
10653  __Pyx_XGOTREF(__pyx_t_3);
10654  __Pyx_XGOTREF(__pyx_t_4);
10655  __Pyx_XGOTREF(__pyx_t_5);
10656  /*try:*/ {
10657 
10658  /* "View.MemoryView":434
10659  * if not isinstance(obj, memoryview):
10660  * try:
10661  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10662  * self.dtype_is_object)
10663  * except TypeError:
10664  */
10665  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
10666  __pyx_t_6 = __Pyx_PyInt_From_int(((__pyx_v_self->flags & (~PyBUF_WRITABLE)) | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 434, __pyx_L4_error)
10667  __Pyx_GOTREF(__pyx_t_6);
10668 
10669  /* "View.MemoryView":435
10670  * try:
10671  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10672  * self.dtype_is_object) # <<<<<<<<<<<<<<
10673  * except TypeError:
10674  * return None
10675  */
10676  __Pyx_TraceLine(435,0,__PYX_ERR(1, 435, __pyx_L4_error))
10677  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 435, __pyx_L4_error)
10678  __Pyx_GOTREF(__pyx_t_7);
10679 
10680  /* "View.MemoryView":434
10681  * if not isinstance(obj, memoryview):
10682  * try:
10683  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
10684  * self.dtype_is_object)
10685  * except TypeError:
10686  */
10687  __Pyx_TraceLine(434,0,__PYX_ERR(1, 434, __pyx_L4_error))
10688  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 434, __pyx_L4_error)
10689  __Pyx_GOTREF(__pyx_t_8);
10690  __Pyx_INCREF(__pyx_v_obj);
10691  __Pyx_GIVEREF(__pyx_v_obj);
10692  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
10693  __Pyx_GIVEREF(__pyx_t_6);
10694  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
10695  __Pyx_GIVEREF(__pyx_t_7);
10696  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
10697  __pyx_t_6 = 0;
10698  __pyx_t_7 = 0;
10699  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 434, __pyx_L4_error)
10700  __Pyx_GOTREF(__pyx_t_7);
10701  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10702  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
10703  __pyx_t_7 = 0;
10704 
10705  /* "View.MemoryView":433
10706  * cdef is_slice(self, obj):
10707  * if not isinstance(obj, memoryview):
10708  * try: # <<<<<<<<<<<<<<
10709  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10710  * self.dtype_is_object)
10711  */
10712  }
10713  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
10714  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
10715  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
10716  goto __pyx_L9_try_end;
10717  __pyx_L4_error:;
10718  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10719  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10720  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
10721 
10722  /* "View.MemoryView":436
10723  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10724  * self.dtype_is_object)
10725  * except TypeError: # <<<<<<<<<<<<<<
10726  * return None
10727  *
10728  */
10729  __Pyx_TraceLine(436,0,__PYX_ERR(1, 436, __pyx_L6_except_error))
10730  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
10731  if (__pyx_t_9) {
10732  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10733  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(1, 436, __pyx_L6_except_error)
10734  __Pyx_GOTREF(__pyx_t_7);
10735  __Pyx_GOTREF(__pyx_t_8);
10736  __Pyx_GOTREF(__pyx_t_6);
10737 
10738  /* "View.MemoryView":437
10739  * self.dtype_is_object)
10740  * except TypeError:
10741  * return None # <<<<<<<<<<<<<<
10742  *
10743  * return obj
10744  */
10745  __Pyx_TraceLine(437,0,__PYX_ERR(1, 437, __pyx_L6_except_error))
10746  __Pyx_XDECREF(__pyx_r);
10747  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10748  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
10749  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10750  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
10751  goto __pyx_L7_except_return;
10752  }
10753  goto __pyx_L6_except_error;
10754  __pyx_L6_except_error:;
10755 
10756  /* "View.MemoryView":433
10757  * cdef is_slice(self, obj):
10758  * if not isinstance(obj, memoryview):
10759  * try: # <<<<<<<<<<<<<<
10760  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10761  * self.dtype_is_object)
10762  */
10763  __Pyx_XGIVEREF(__pyx_t_3);
10764  __Pyx_XGIVEREF(__pyx_t_4);
10765  __Pyx_XGIVEREF(__pyx_t_5);
10766  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10767  goto __pyx_L1_error;
10768  __pyx_L7_except_return:;
10769  __Pyx_XGIVEREF(__pyx_t_3);
10770  __Pyx_XGIVEREF(__pyx_t_4);
10771  __Pyx_XGIVEREF(__pyx_t_5);
10772  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
10773  goto __pyx_L0;
10774  __pyx_L9_try_end:;
10775  }
10776 
10777  /* "View.MemoryView":432
10778  *
10779  * cdef is_slice(self, obj):
10780  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
10781  * try:
10782  * obj = memoryview(obj, self.flags & ~PyBUF_WRITABLE | PyBUF_ANY_CONTIGUOUS,
10783  */
10784  }
10785 
10786  /* "View.MemoryView":439
10787  * return None
10788  *
10789  * return obj # <<<<<<<<<<<<<<
10790  *
10791  * cdef setitem_slice_assignment(self, dst, src):
10792  */
10793  __Pyx_TraceLine(439,0,__PYX_ERR(1, 439, __pyx_L1_error))
10794  __Pyx_XDECREF(__pyx_r);
10795  __Pyx_INCREF(__pyx_v_obj);
10796  __pyx_r = __pyx_v_obj;
10797  goto __pyx_L0;
10798 
10799  /* "View.MemoryView":431
10800  * self.setitem_indexed(index, value)
10801  *
10802  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
10803  * if not isinstance(obj, memoryview):
10804  * try:
10805  */
10806 
10807  /* function exit code */
10808  __pyx_L1_error:;
10809  __Pyx_XDECREF(__pyx_t_6);
10810  __Pyx_XDECREF(__pyx_t_7);
10811  __Pyx_XDECREF(__pyx_t_8);
10812  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
10813  __pyx_r = 0;
10814  __pyx_L0:;
10815  __Pyx_XDECREF(__pyx_v_obj);
10816  __Pyx_XGIVEREF(__pyx_r);
10817  __Pyx_TraceReturn(__pyx_r, 0);
10818  __Pyx_RefNannyFinishContext();
10819  return __pyx_r;
10820 }
10821 
10822 /* "View.MemoryView":441
10823  * return obj
10824  *
10825  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10826  * cdef __Pyx_memviewslice dst_slice
10827  * cdef __Pyx_memviewslice src_slice
10828  */
10829 
10830 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
10831  __Pyx_memviewslice __pyx_v_dst_slice;
10832  __Pyx_memviewslice __pyx_v_src_slice;
10833  PyObject *__pyx_r = NULL;
10834  __Pyx_TraceDeclarations
10835  __Pyx_RefNannyDeclarations
10836  __Pyx_memviewslice *__pyx_t_1;
10837  __Pyx_memviewslice *__pyx_t_2;
10838  PyObject *__pyx_t_3 = NULL;
10839  int __pyx_t_4;
10840  int __pyx_t_5;
10841  int __pyx_t_6;
10842  int __pyx_lineno = 0;
10843  const char *__pyx_filename = NULL;
10844  int __pyx_clineno = 0;
10845  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
10846  __Pyx_TraceCall("setitem_slice_assignment", __pyx_f[1], 441, 0, __PYX_ERR(1, 441, __pyx_L1_error));
10847 
10848  /* "View.MemoryView":445
10849  * cdef __Pyx_memviewslice src_slice
10850  *
10851  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10852  * get_slice_from_memview(dst, &dst_slice)[0],
10853  * src.ndim, dst.ndim, self.dtype_is_object)
10854  */
10855  __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
10856  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(1, 445, __pyx_L1_error)
10857  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 445, __pyx_L1_error)
10858 
10859  /* "View.MemoryView":446
10860  *
10861  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10862  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
10863  * src.ndim, dst.ndim, self.dtype_is_object)
10864  *
10865  */
10866  __Pyx_TraceLine(446,0,__PYX_ERR(1, 446, __pyx_L1_error))
10867  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(1, 446, __pyx_L1_error)
10868  __pyx_t_2 = __pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice)); if (unlikely(__pyx_t_2 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 446, __pyx_L1_error)
10869 
10870  /* "View.MemoryView":447
10871  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
10872  * get_slice_from_memview(dst, &dst_slice)[0],
10873  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
10874  *
10875  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10876  */
10877  __Pyx_TraceLine(447,0,__PYX_ERR(1, 447, __pyx_L1_error))
10878  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10879  __Pyx_GOTREF(__pyx_t_3);
10880  __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10881  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10882  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 447, __pyx_L1_error)
10883  __Pyx_GOTREF(__pyx_t_3);
10884  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 447, __pyx_L1_error)
10885  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10886 
10887  /* "View.MemoryView":445
10888  * cdef __Pyx_memviewslice src_slice
10889  *
10890  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
10891  * get_slice_from_memview(dst, &dst_slice)[0],
10892  * src.ndim, dst.ndim, self.dtype_is_object)
10893  */
10894  __Pyx_TraceLine(445,0,__PYX_ERR(1, 445, __pyx_L1_error))
10895  __pyx_t_6 = __pyx_memoryview_copy_contents((__pyx_t_1[0]), (__pyx_t_2[0]), __pyx_t_4, __pyx_t_5, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 445, __pyx_L1_error)
10896 
10897  /* "View.MemoryView":441
10898  * return obj
10899  *
10900  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
10901  * cdef __Pyx_memviewslice dst_slice
10902  * cdef __Pyx_memviewslice src_slice
10903  */
10904 
10905  /* function exit code */
10906  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10907  goto __pyx_L0;
10908  __pyx_L1_error:;
10909  __Pyx_XDECREF(__pyx_t_3);
10910  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
10911  __pyx_r = 0;
10912  __pyx_L0:;
10913  __Pyx_XGIVEREF(__pyx_r);
10914  __Pyx_TraceReturn(__pyx_r, 0);
10915  __Pyx_RefNannyFinishContext();
10916  return __pyx_r;
10917 }
10918 
10919 /* "View.MemoryView":449
10920  * src.ndim, dst.ndim, self.dtype_is_object)
10921  *
10922  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
10923  * cdef int array[128]
10924  * cdef void *tmp = NULL
10925  */
10926 
10927 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
10928  int __pyx_v_array[0x80];
10929  void *__pyx_v_tmp;
10930  void *__pyx_v_item;
10931  __Pyx_memviewslice *__pyx_v_dst_slice;
10932  __Pyx_memviewslice __pyx_v_tmp_slice;
10933  PyObject *__pyx_r = NULL;
10934  __Pyx_TraceDeclarations
10935  __Pyx_RefNannyDeclarations
10936  __Pyx_memviewslice *__pyx_t_1;
10937  int __pyx_t_2;
10938  PyObject *__pyx_t_3 = NULL;
10939  int __pyx_t_4;
10940  int __pyx_t_5;
10941  char const *__pyx_t_6;
10942  PyObject *__pyx_t_7 = NULL;
10943  PyObject *__pyx_t_8 = NULL;
10944  PyObject *__pyx_t_9 = NULL;
10945  PyObject *__pyx_t_10 = NULL;
10946  PyObject *__pyx_t_11 = NULL;
10947  PyObject *__pyx_t_12 = NULL;
10948  int __pyx_lineno = 0;
10949  const char *__pyx_filename = NULL;
10950  int __pyx_clineno = 0;
10951  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
10952  __Pyx_TraceCall("setitem_slice_assign_scalar", __pyx_f[1], 449, 0, __PYX_ERR(1, 449, __pyx_L1_error));
10953 
10954  /* "View.MemoryView":451
10955  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
10956  * cdef int array[128]
10957  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
10958  * cdef void *item
10959  *
10960  */
10961  __Pyx_TraceLine(451,0,__PYX_ERR(1, 451, __pyx_L1_error))
10962  __pyx_v_tmp = NULL;
10963 
10964  /* "View.MemoryView":456
10965  * cdef __Pyx_memviewslice *dst_slice
10966  * cdef __Pyx_memviewslice tmp_slice
10967  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
10968  *
10969  * if <size_t>self.view.itemsize > sizeof(array):
10970  */
10971  __Pyx_TraceLine(456,0,__PYX_ERR(1, 456, __pyx_L1_error))
10972  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 456, __pyx_L1_error)
10973  __pyx_v_dst_slice = __pyx_t_1;
10974 
10975  /* "View.MemoryView":458
10976  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
10977  *
10978  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
10979  * tmp = PyMem_Malloc(self.view.itemsize)
10980  * if tmp == NULL:
10981  */
10982  __Pyx_TraceLine(458,0,__PYX_ERR(1, 458, __pyx_L1_error))
10983  __pyx_t_2 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
10984  if (__pyx_t_2) {
10985 
10986  /* "View.MemoryView":459
10987  *
10988  * if <size_t>self.view.itemsize > sizeof(array):
10989  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
10990  * if tmp == NULL:
10991  * raise MemoryError
10992  */
10993  __Pyx_TraceLine(459,0,__PYX_ERR(1, 459, __pyx_L1_error))
10994  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
10995 
10996  /* "View.MemoryView":460
10997  * if <size_t>self.view.itemsize > sizeof(array):
10998  * tmp = PyMem_Malloc(self.view.itemsize)
10999  * if tmp == NULL: # <<<<<<<<<<<<<<
11000  * raise MemoryError
11001  * item = tmp
11002  */
11003  __Pyx_TraceLine(460,0,__PYX_ERR(1, 460, __pyx_L1_error))
11004  __pyx_t_2 = ((__pyx_v_tmp == NULL) != 0);
11005  if (unlikely(__pyx_t_2)) {
11006 
11007  /* "View.MemoryView":461
11008  * tmp = PyMem_Malloc(self.view.itemsize)
11009  * if tmp == NULL:
11010  * raise MemoryError # <<<<<<<<<<<<<<
11011  * item = tmp
11012  * else:
11013  */
11014  __Pyx_TraceLine(461,0,__PYX_ERR(1, 461, __pyx_L1_error))
11015  PyErr_NoMemory(); __PYX_ERR(1, 461, __pyx_L1_error)
11016 
11017  /* "View.MemoryView":460
11018  * if <size_t>self.view.itemsize > sizeof(array):
11019  * tmp = PyMem_Malloc(self.view.itemsize)
11020  * if tmp == NULL: # <<<<<<<<<<<<<<
11021  * raise MemoryError
11022  * item = tmp
11023  */
11024  }
11025 
11026  /* "View.MemoryView":462
11027  * if tmp == NULL:
11028  * raise MemoryError
11029  * item = tmp # <<<<<<<<<<<<<<
11030  * else:
11031  * item = <void *> array
11032  */
11033  __Pyx_TraceLine(462,0,__PYX_ERR(1, 462, __pyx_L1_error))
11034  __pyx_v_item = __pyx_v_tmp;
11035 
11036  /* "View.MemoryView":458
11037  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11038  *
11039  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11040  * tmp = PyMem_Malloc(self.view.itemsize)
11041  * if tmp == NULL:
11042  */
11043  goto __pyx_L3;
11044  }
11045 
11046  /* "View.MemoryView":464
11047  * item = tmp
11048  * else:
11049  * item = <void *> array # <<<<<<<<<<<<<<
11050  *
11051  * try:
11052  */
11053  __Pyx_TraceLine(464,0,__PYX_ERR(1, 464, __pyx_L1_error))
11054  /*else*/ {
11055  __pyx_v_item = ((void *)__pyx_v_array);
11056  }
11057  __pyx_L3:;
11058 
11059  /* "View.MemoryView":466
11060  * item = <void *> array
11061  *
11062  * try: # <<<<<<<<<<<<<<
11063  * if self.dtype_is_object:
11064  * (<PyObject **> item)[0] = <PyObject *> value
11065  */
11066  __Pyx_TraceLine(466,0,__PYX_ERR(1, 466, __pyx_L1_error))
11067  /*try:*/ {
11068 
11069  /* "View.MemoryView":467
11070  *
11071  * try:
11072  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11073  * (<PyObject **> item)[0] = <PyObject *> value
11074  * else:
11075  */
11076  __Pyx_TraceLine(467,0,__PYX_ERR(1, 467, __pyx_L6_error))
11077  __pyx_t_2 = (__pyx_v_self->dtype_is_object != 0);
11078  if (__pyx_t_2) {
11079 
11080  /* "View.MemoryView":468
11081  * try:
11082  * if self.dtype_is_object:
11083  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11084  * else:
11085  * self.assign_item_from_object(<char *> item, value)
11086  */
11087  __Pyx_TraceLine(468,0,__PYX_ERR(1, 468, __pyx_L6_error))
11088  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11089 
11090  /* "View.MemoryView":467
11091  *
11092  * try:
11093  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11094  * (<PyObject **> item)[0] = <PyObject *> value
11095  * else:
11096  */
11097  goto __pyx_L8;
11098  }
11099 
11100  /* "View.MemoryView":470
11101  * (<PyObject **> item)[0] = <PyObject *> value
11102  * else:
11103  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11104  *
11105  *
11106  */
11107  __Pyx_TraceLine(470,0,__PYX_ERR(1, 470, __pyx_L6_error))
11108  /*else*/ {
11109  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 470, __pyx_L6_error)
11110  __Pyx_GOTREF(__pyx_t_3);
11111  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11112  }
11113  __pyx_L8:;
11114 
11115  /* "View.MemoryView":474
11116  *
11117  *
11118  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11119  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11120  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11121  */
11122  __Pyx_TraceLine(474,0,__PYX_ERR(1, 474, __pyx_L6_error))
11123  __pyx_t_2 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11124  if (__pyx_t_2) {
11125 
11126  /* "View.MemoryView":475
11127  *
11128  * if self.view.suboffsets != NULL:
11129  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11130  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11131  * item, self.dtype_is_object)
11132  */
11133  __Pyx_TraceLine(475,0,__PYX_ERR(1, 475, __pyx_L6_error))
11134  __pyx_t_3 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 475, __pyx_L6_error)
11135  __Pyx_GOTREF(__pyx_t_3);
11136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11137 
11138  /* "View.MemoryView":474
11139  *
11140  *
11141  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11142  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11143  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11144  */
11145  }
11146 
11147  /* "View.MemoryView":476
11148  * if self.view.suboffsets != NULL:
11149  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11150  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11151  * item, self.dtype_is_object)
11152  * finally:
11153  */
11154  __Pyx_TraceLine(476,0,__PYX_ERR(1, 476, __pyx_L6_error))
11155  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11156  }
11157 
11158  /* "View.MemoryView":479
11159  * item, self.dtype_is_object)
11160  * finally:
11161  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11162  *
11163  * cdef setitem_indexed(self, index, value):
11164  */
11165  __Pyx_TraceLine(479,0,__PYX_ERR(1, 479, __pyx_L6_error))
11166  /*finally:*/ {
11167  /*normal exit:*/{
11168  PyMem_Free(__pyx_v_tmp);
11169  goto __pyx_L7;
11170  }
11171  __pyx_L6_error:;
11172  /*exception exit:*/{
11173  __Pyx_PyThreadState_declare
11174  __Pyx_PyThreadState_assign
11175  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11176  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11177  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_10, &__pyx_t_11, &__pyx_t_12);
11178  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9) < 0)) __Pyx_ErrFetch(&__pyx_t_7, &__pyx_t_8, &__pyx_t_9);
11179  __Pyx_XGOTREF(__pyx_t_7);
11180  __Pyx_XGOTREF(__pyx_t_8);
11181  __Pyx_XGOTREF(__pyx_t_9);
11182  __Pyx_XGOTREF(__pyx_t_10);
11183  __Pyx_XGOTREF(__pyx_t_11);
11184  __Pyx_XGOTREF(__pyx_t_12);
11185  __pyx_t_4 = __pyx_lineno; __pyx_t_5 = __pyx_clineno; __pyx_t_6 = __pyx_filename;
11186  {
11187  PyMem_Free(__pyx_v_tmp);
11188  }
11189  if (PY_MAJOR_VERSION >= 3) {
11190  __Pyx_XGIVEREF(__pyx_t_10);
11191  __Pyx_XGIVEREF(__pyx_t_11);
11192  __Pyx_XGIVEREF(__pyx_t_12);
11193  __Pyx_ExceptionReset(__pyx_t_10, __pyx_t_11, __pyx_t_12);
11194  }
11195  __Pyx_XGIVEREF(__pyx_t_7);
11196  __Pyx_XGIVEREF(__pyx_t_8);
11197  __Pyx_XGIVEREF(__pyx_t_9);
11198  __Pyx_ErrRestore(__pyx_t_7, __pyx_t_8, __pyx_t_9);
11199  __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0; __pyx_t_12 = 0;
11200  __pyx_lineno = __pyx_t_4; __pyx_clineno = __pyx_t_5; __pyx_filename = __pyx_t_6;
11201  goto __pyx_L1_error;
11202  }
11203  __pyx_L7:;
11204  }
11205 
11206  /* "View.MemoryView":449
11207  * src.ndim, dst.ndim, self.dtype_is_object)
11208  *
11209  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11210  * cdef int array[128]
11211  * cdef void *tmp = NULL
11212  */
11213 
11214  /* function exit code */
11215  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11216  goto __pyx_L0;
11217  __pyx_L1_error:;
11218  __Pyx_XDECREF(__pyx_t_3);
11219  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11220  __pyx_r = 0;
11221  __pyx_L0:;
11222  __Pyx_XGIVEREF(__pyx_r);
11223  __Pyx_TraceReturn(__pyx_r, 0);
11224  __Pyx_RefNannyFinishContext();
11225  return __pyx_r;
11226 }
11227 
11228 /* "View.MemoryView":481
11229  * PyMem_Free(tmp)
11230  *
11231  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11232  * cdef char *itemp = self.get_item_pointer(index)
11233  * self.assign_item_from_object(itemp, value)
11234  */
11235 
11236 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11237  char *__pyx_v_itemp;
11238  PyObject *__pyx_r = NULL;
11239  __Pyx_TraceDeclarations
11240  __Pyx_RefNannyDeclarations
11241  char *__pyx_t_1;
11242  PyObject *__pyx_t_2 = NULL;
11243  int __pyx_lineno = 0;
11244  const char *__pyx_filename = NULL;
11245  int __pyx_clineno = 0;
11246  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11247  __Pyx_TraceCall("setitem_indexed", __pyx_f[1], 481, 0, __PYX_ERR(1, 481, __pyx_L1_error));
11248 
11249  /* "View.MemoryView":482
11250  *
11251  * cdef setitem_indexed(self, index, value):
11252  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11253  * self.assign_item_from_object(itemp, value)
11254  *
11255  */
11256  __Pyx_TraceLine(482,0,__PYX_ERR(1, 482, __pyx_L1_error))
11257  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(1, 482, __pyx_L1_error)
11258  __pyx_v_itemp = __pyx_t_1;
11259 
11260  /* "View.MemoryView":483
11261  * cdef setitem_indexed(self, index, value):
11262  * cdef char *itemp = self.get_item_pointer(index)
11263  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11264  *
11265  * cdef convert_item_to_object(self, char *itemp):
11266  */
11267  __Pyx_TraceLine(483,0,__PYX_ERR(1, 483, __pyx_L1_error))
11268  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 483, __pyx_L1_error)
11269  __Pyx_GOTREF(__pyx_t_2);
11270  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11271 
11272  /* "View.MemoryView":481
11273  * PyMem_Free(tmp)
11274  *
11275  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11276  * cdef char *itemp = self.get_item_pointer(index)
11277  * self.assign_item_from_object(itemp, value)
11278  */
11279 
11280  /* function exit code */
11281  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11282  goto __pyx_L0;
11283  __pyx_L1_error:;
11284  __Pyx_XDECREF(__pyx_t_2);
11285  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11286  __pyx_r = 0;
11287  __pyx_L0:;
11288  __Pyx_XGIVEREF(__pyx_r);
11289  __Pyx_TraceReturn(__pyx_r, 0);
11290  __Pyx_RefNannyFinishContext();
11291  return __pyx_r;
11292 }
11293 
11294 /* "View.MemoryView":485
11295  * self.assign_item_from_object(itemp, value)
11296  *
11297  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11298  * """Only used if instantiated manually by the user, or if Cython doesn't
11299  * know how to convert the type"""
11300  */
11301 
11302 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11303  PyObject *__pyx_v_struct = NULL;
11304  PyObject *__pyx_v_bytesitem = 0;
11305  PyObject *__pyx_v_result = NULL;
11306  PyObject *__pyx_r = NULL;
11307  __Pyx_TraceDeclarations
11308  __Pyx_RefNannyDeclarations
11309  PyObject *__pyx_t_1 = NULL;
11310  PyObject *__pyx_t_2 = NULL;
11311  PyObject *__pyx_t_3 = NULL;
11312  PyObject *__pyx_t_4 = NULL;
11313  PyObject *__pyx_t_5 = NULL;
11314  PyObject *__pyx_t_6 = NULL;
11315  PyObject *__pyx_t_7 = NULL;
11316  int __pyx_t_8;
11317  PyObject *__pyx_t_9 = NULL;
11318  size_t __pyx_t_10;
11319  int __pyx_t_11;
11320  int __pyx_lineno = 0;
11321  const char *__pyx_filename = NULL;
11322  int __pyx_clineno = 0;
11323  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11324  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 485, 0, __PYX_ERR(1, 485, __pyx_L1_error));
11325 
11326  /* "View.MemoryView":488
11327  * """Only used if instantiated manually by the user, or if Cython doesn't
11328  * know how to convert the type"""
11329  * import struct # <<<<<<<<<<<<<<
11330  * cdef bytes bytesitem
11331  *
11332  */
11333  __Pyx_TraceLine(488,0,__PYX_ERR(1, 488, __pyx_L1_error))
11334  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 488, __pyx_L1_error)
11335  __Pyx_GOTREF(__pyx_t_1);
11336  __pyx_v_struct = __pyx_t_1;
11337  __pyx_t_1 = 0;
11338 
11339  /* "View.MemoryView":491
11340  * cdef bytes bytesitem
11341  *
11342  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11343  * try:
11344  * result = struct.unpack(self.view.format, bytesitem)
11345  */
11346  __Pyx_TraceLine(491,0,__PYX_ERR(1, 491, __pyx_L1_error))
11347  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 491, __pyx_L1_error)
11348  __Pyx_GOTREF(__pyx_t_1);
11349  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11350  __pyx_t_1 = 0;
11351 
11352  /* "View.MemoryView":492
11353  *
11354  * bytesitem = itemp[:self.view.itemsize]
11355  * try: # <<<<<<<<<<<<<<
11356  * result = struct.unpack(self.view.format, bytesitem)
11357  * except struct.error:
11358  */
11359  __Pyx_TraceLine(492,0,__PYX_ERR(1, 492, __pyx_L1_error))
11360  {
11361  __Pyx_PyThreadState_declare
11362  __Pyx_PyThreadState_assign
11363  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11364  __Pyx_XGOTREF(__pyx_t_2);
11365  __Pyx_XGOTREF(__pyx_t_3);
11366  __Pyx_XGOTREF(__pyx_t_4);
11367  /*try:*/ {
11368 
11369  /* "View.MemoryView":493
11370  * bytesitem = itemp[:self.view.itemsize]
11371  * try:
11372  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
11373  * except struct.error:
11374  * raise ValueError("Unable to convert item to object")
11375  */
11376  __Pyx_TraceLine(493,0,__PYX_ERR(1, 493, __pyx_L3_error))
11377  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 493, __pyx_L3_error)
11378  __Pyx_GOTREF(__pyx_t_5);
11379  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 493, __pyx_L3_error)
11380  __Pyx_GOTREF(__pyx_t_6);
11381  __pyx_t_7 = NULL;
11382  __pyx_t_8 = 0;
11383  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
11384  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
11385  if (likely(__pyx_t_7)) {
11386  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11387  __Pyx_INCREF(__pyx_t_7);
11388  __Pyx_INCREF(function);
11389  __Pyx_DECREF_SET(__pyx_t_5, function);
11390  __pyx_t_8 = 1;
11391  }
11392  }
11393  #if CYTHON_FAST_PYCALL
11394  if (PyFunction_Check(__pyx_t_5)) {
11395  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11396  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11397  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11398  __Pyx_GOTREF(__pyx_t_1);
11399  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11400  } else
11401  #endif
11402  #if CYTHON_FAST_PYCCALL
11403  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11404  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
11405  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11406  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11407  __Pyx_GOTREF(__pyx_t_1);
11408  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11409  } else
11410  #endif
11411  {
11412  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 493, __pyx_L3_error)
11413  __Pyx_GOTREF(__pyx_t_9);
11414  if (__pyx_t_7) {
11415  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
11416  }
11417  __Pyx_GIVEREF(__pyx_t_6);
11418  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
11419  __Pyx_INCREF(__pyx_v_bytesitem);
11420  __Pyx_GIVEREF(__pyx_v_bytesitem);
11421  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
11422  __pyx_t_6 = 0;
11423  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 493, __pyx_L3_error)
11424  __Pyx_GOTREF(__pyx_t_1);
11425  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11426  }
11427  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11428  __pyx_v_result = __pyx_t_1;
11429  __pyx_t_1 = 0;
11430 
11431  /* "View.MemoryView":492
11432  *
11433  * bytesitem = itemp[:self.view.itemsize]
11434  * try: # <<<<<<<<<<<<<<
11435  * result = struct.unpack(self.view.format, bytesitem)
11436  * except struct.error:
11437  */
11438  }
11439 
11440  /* "View.MemoryView":497
11441  * raise ValueError("Unable to convert item to object")
11442  * else:
11443  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11444  * return result[0]
11445  * return result
11446  */
11447  __Pyx_TraceLine(497,0,__PYX_ERR(1, 497, __pyx_L5_except_error))
11448  /*else:*/ {
11449  __pyx_t_10 = strlen(__pyx_v_self->view.format);
11450  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
11451  if (__pyx_t_11) {
11452 
11453  /* "View.MemoryView":498
11454  * else:
11455  * if len(self.view.format) == 1:
11456  * return result[0] # <<<<<<<<<<<<<<
11457  * return result
11458  *
11459  */
11460  __Pyx_TraceLine(498,0,__PYX_ERR(1, 498, __pyx_L5_except_error))
11461  __Pyx_XDECREF(__pyx_r);
11462  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 498, __pyx_L5_except_error)
11463  __Pyx_GOTREF(__pyx_t_1);
11464  __pyx_r = __pyx_t_1;
11465  __pyx_t_1 = 0;
11466  goto __pyx_L6_except_return;
11467 
11468  /* "View.MemoryView":497
11469  * raise ValueError("Unable to convert item to object")
11470  * else:
11471  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
11472  * return result[0]
11473  * return result
11474  */
11475  }
11476 
11477  /* "View.MemoryView":499
11478  * if len(self.view.format) == 1:
11479  * return result[0]
11480  * return result # <<<<<<<<<<<<<<
11481  *
11482  * cdef assign_item_from_object(self, char *itemp, object value):
11483  */
11484  __Pyx_TraceLine(499,0,__PYX_ERR(1, 499, __pyx_L5_except_error))
11485  __Pyx_XDECREF(__pyx_r);
11486  __Pyx_INCREF(__pyx_v_result);
11487  __pyx_r = __pyx_v_result;
11488  goto __pyx_L6_except_return;
11489  }
11490  __pyx_L3_error:;
11491  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11492  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11493  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11494  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11495  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
11496 
11497  /* "View.MemoryView":494
11498  * try:
11499  * result = struct.unpack(self.view.format, bytesitem)
11500  * except struct.error: # <<<<<<<<<<<<<<
11501  * raise ValueError("Unable to convert item to object")
11502  * else:
11503  */
11504  __Pyx_TraceLine(494,0,__PYX_ERR(1, 494, __pyx_L5_except_error))
11505  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
11506  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 494, __pyx_L5_except_error)
11507  __Pyx_GOTREF(__pyx_t_6);
11508  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
11509  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11510  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
11511  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
11512  if (__pyx_t_8) {
11513  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11514  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(1, 494, __pyx_L5_except_error)
11515  __Pyx_GOTREF(__pyx_t_9);
11516  __Pyx_GOTREF(__pyx_t_5);
11517  __Pyx_GOTREF(__pyx_t_1);
11518 
11519  /* "View.MemoryView":495
11520  * result = struct.unpack(self.view.format, bytesitem)
11521  * except struct.error:
11522  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
11523  * else:
11524  * if len(self.view.format) == 1:
11525  */
11526  __Pyx_TraceLine(495,0,__PYX_ERR(1, 495, __pyx_L5_except_error))
11527  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 495, __pyx_L5_except_error)
11528  __Pyx_GOTREF(__pyx_t_6);
11529  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
11530  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11531  __PYX_ERR(1, 495, __pyx_L5_except_error)
11532  }
11533  goto __pyx_L5_except_error;
11534  __pyx_L5_except_error:;
11535 
11536  /* "View.MemoryView":492
11537  *
11538  * bytesitem = itemp[:self.view.itemsize]
11539  * try: # <<<<<<<<<<<<<<
11540  * result = struct.unpack(self.view.format, bytesitem)
11541  * except struct.error:
11542  */
11543  __Pyx_XGIVEREF(__pyx_t_2);
11544  __Pyx_XGIVEREF(__pyx_t_3);
11545  __Pyx_XGIVEREF(__pyx_t_4);
11546  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11547  goto __pyx_L1_error;
11548  __pyx_L6_except_return:;
11549  __Pyx_XGIVEREF(__pyx_t_2);
11550  __Pyx_XGIVEREF(__pyx_t_3);
11551  __Pyx_XGIVEREF(__pyx_t_4);
11552  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
11553  goto __pyx_L0;
11554  }
11555 
11556  /* "View.MemoryView":485
11557  * self.assign_item_from_object(itemp, value)
11558  *
11559  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11560  * """Only used if instantiated manually by the user, or if Cython doesn't
11561  * know how to convert the type"""
11562  */
11563 
11564  /* function exit code */
11565  __pyx_L1_error:;
11566  __Pyx_XDECREF(__pyx_t_1);
11567  __Pyx_XDECREF(__pyx_t_5);
11568  __Pyx_XDECREF(__pyx_t_6);
11569  __Pyx_XDECREF(__pyx_t_7);
11570  __Pyx_XDECREF(__pyx_t_9);
11571  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11572  __pyx_r = 0;
11573  __pyx_L0:;
11574  __Pyx_XDECREF(__pyx_v_struct);
11575  __Pyx_XDECREF(__pyx_v_bytesitem);
11576  __Pyx_XDECREF(__pyx_v_result);
11577  __Pyx_XGIVEREF(__pyx_r);
11578  __Pyx_TraceReturn(__pyx_r, 0);
11579  __Pyx_RefNannyFinishContext();
11580  return __pyx_r;
11581 }
11582 
11583 /* "View.MemoryView":501
11584  * return result
11585  *
11586  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11587  * """Only used if instantiated manually by the user, or if Cython doesn't
11588  * know how to convert the type"""
11589  */
11590 
11591 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
11592  PyObject *__pyx_v_struct = NULL;
11593  char __pyx_v_c;
11594  PyObject *__pyx_v_bytesvalue = 0;
11595  Py_ssize_t __pyx_v_i;
11596  PyObject *__pyx_r = NULL;
11597  __Pyx_TraceDeclarations
11598  __Pyx_RefNannyDeclarations
11599  PyObject *__pyx_t_1 = NULL;
11600  int __pyx_t_2;
11601  int __pyx_t_3;
11602  PyObject *__pyx_t_4 = NULL;
11603  PyObject *__pyx_t_5 = NULL;
11604  PyObject *__pyx_t_6 = NULL;
11605  int __pyx_t_7;
11606  PyObject *__pyx_t_8 = NULL;
11607  Py_ssize_t __pyx_t_9;
11608  PyObject *__pyx_t_10 = NULL;
11609  char *__pyx_t_11;
11610  char *__pyx_t_12;
11611  char *__pyx_t_13;
11612  char *__pyx_t_14;
11613  int __pyx_lineno = 0;
11614  const char *__pyx_filename = NULL;
11615  int __pyx_clineno = 0;
11616  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
11617  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 501, 0, __PYX_ERR(1, 501, __pyx_L1_error));
11618 
11619  /* "View.MemoryView":504
11620  * """Only used if instantiated manually by the user, or if Cython doesn't
11621  * know how to convert the type"""
11622  * import struct # <<<<<<<<<<<<<<
11623  * cdef char c
11624  * cdef bytes bytesvalue
11625  */
11626  __Pyx_TraceLine(504,0,__PYX_ERR(1, 504, __pyx_L1_error))
11627  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 504, __pyx_L1_error)
11628  __Pyx_GOTREF(__pyx_t_1);
11629  __pyx_v_struct = __pyx_t_1;
11630  __pyx_t_1 = 0;
11631 
11632  /* "View.MemoryView":509
11633  * cdef Py_ssize_t i
11634  *
11635  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11636  * bytesvalue = struct.pack(self.view.format, *value)
11637  * else:
11638  */
11639  __Pyx_TraceLine(509,0,__PYX_ERR(1, 509, __pyx_L1_error))
11640  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
11641  __pyx_t_3 = (__pyx_t_2 != 0);
11642  if (__pyx_t_3) {
11643 
11644  /* "View.MemoryView":510
11645  *
11646  * if isinstance(value, tuple):
11647  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
11648  * else:
11649  * bytesvalue = struct.pack(self.view.format, value)
11650  */
11651  __Pyx_TraceLine(510,0,__PYX_ERR(1, 510, __pyx_L1_error))
11652  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 510, __pyx_L1_error)
11653  __Pyx_GOTREF(__pyx_t_1);
11654  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11655  __Pyx_GOTREF(__pyx_t_4);
11656  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 510, __pyx_L1_error)
11657  __Pyx_GOTREF(__pyx_t_5);
11658  __Pyx_GIVEREF(__pyx_t_4);
11659  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
11660  __pyx_t_4 = 0;
11661  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11662  __Pyx_GOTREF(__pyx_t_4);
11663  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 510, __pyx_L1_error)
11664  __Pyx_GOTREF(__pyx_t_6);
11665  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11666  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11667  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 510, __pyx_L1_error)
11668  __Pyx_GOTREF(__pyx_t_4);
11669  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11670  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11671  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 510, __pyx_L1_error)
11672  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11673  __pyx_t_4 = 0;
11674 
11675  /* "View.MemoryView":509
11676  * cdef Py_ssize_t i
11677  *
11678  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
11679  * bytesvalue = struct.pack(self.view.format, *value)
11680  * else:
11681  */
11682  goto __pyx_L3;
11683  }
11684 
11685  /* "View.MemoryView":512
11686  * bytesvalue = struct.pack(self.view.format, *value)
11687  * else:
11688  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
11689  *
11690  * for i, c in enumerate(bytesvalue):
11691  */
11692  __Pyx_TraceLine(512,0,__PYX_ERR(1, 512, __pyx_L1_error))
11693  /*else*/ {
11694  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 512, __pyx_L1_error)
11695  __Pyx_GOTREF(__pyx_t_6);
11696  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 512, __pyx_L1_error)
11697  __Pyx_GOTREF(__pyx_t_1);
11698  __pyx_t_5 = NULL;
11699  __pyx_t_7 = 0;
11700  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
11701  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
11702  if (likely(__pyx_t_5)) {
11703  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
11704  __Pyx_INCREF(__pyx_t_5);
11705  __Pyx_INCREF(function);
11706  __Pyx_DECREF_SET(__pyx_t_6, function);
11707  __pyx_t_7 = 1;
11708  }
11709  }
11710  #if CYTHON_FAST_PYCALL
11711  if (PyFunction_Check(__pyx_t_6)) {
11712  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11713  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11714  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11715  __Pyx_GOTREF(__pyx_t_4);
11716  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11717  } else
11718  #endif
11719  #if CYTHON_FAST_PYCCALL
11720  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
11721  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
11722  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11723  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11724  __Pyx_GOTREF(__pyx_t_4);
11725  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11726  } else
11727  #endif
11728  {
11729  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 512, __pyx_L1_error)
11730  __Pyx_GOTREF(__pyx_t_8);
11731  if (__pyx_t_5) {
11732  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
11733  }
11734  __Pyx_GIVEREF(__pyx_t_1);
11735  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
11736  __Pyx_INCREF(__pyx_v_value);
11737  __Pyx_GIVEREF(__pyx_v_value);
11738  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
11739  __pyx_t_1 = 0;
11740  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 512, __pyx_L1_error)
11741  __Pyx_GOTREF(__pyx_t_4);
11742  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11743  }
11744  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11745  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(1, 512, __pyx_L1_error)
11746  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
11747  __pyx_t_4 = 0;
11748  }
11749  __pyx_L3:;
11750 
11751  /* "View.MemoryView":514
11752  * bytesvalue = struct.pack(self.view.format, value)
11753  *
11754  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11755  * itemp[i] = c
11756  *
11757  */
11758  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11759  __pyx_t_9 = 0;
11760  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
11761  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
11762  __PYX_ERR(1, 514, __pyx_L1_error)
11763  }
11764  __Pyx_INCREF(__pyx_v_bytesvalue);
11765  __pyx_t_10 = __pyx_v_bytesvalue;
11766  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
11767  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
11768  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
11769  __pyx_t_11 = __pyx_t_14;
11770  __pyx_v_c = (__pyx_t_11[0]);
11771 
11772  /* "View.MemoryView":515
11773  *
11774  * for i, c in enumerate(bytesvalue):
11775  * itemp[i] = c # <<<<<<<<<<<<<<
11776  *
11777  * @cname('getbuffer')
11778  */
11779  __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
11780  __pyx_v_i = __pyx_t_9;
11781 
11782  /* "View.MemoryView":514
11783  * bytesvalue = struct.pack(self.view.format, value)
11784  *
11785  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
11786  * itemp[i] = c
11787  *
11788  */
11789  __Pyx_TraceLine(514,0,__PYX_ERR(1, 514, __pyx_L1_error))
11790  __pyx_t_9 = (__pyx_t_9 + 1);
11791 
11792  /* "View.MemoryView":515
11793  *
11794  * for i, c in enumerate(bytesvalue):
11795  * itemp[i] = c # <<<<<<<<<<<<<<
11796  *
11797  * @cname('getbuffer')
11798  */
11799  __Pyx_TraceLine(515,0,__PYX_ERR(1, 515, __pyx_L1_error))
11800  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
11801  }
11802  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
11803 
11804  /* "View.MemoryView":501
11805  * return result
11806  *
11807  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
11808  * """Only used if instantiated manually by the user, or if Cython doesn't
11809  * know how to convert the type"""
11810  */
11811 
11812  /* function exit code */
11813  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11814  goto __pyx_L0;
11815  __pyx_L1_error:;
11816  __Pyx_XDECREF(__pyx_t_1);
11817  __Pyx_XDECREF(__pyx_t_4);
11818  __Pyx_XDECREF(__pyx_t_5);
11819  __Pyx_XDECREF(__pyx_t_6);
11820  __Pyx_XDECREF(__pyx_t_8);
11821  __Pyx_XDECREF(__pyx_t_10);
11822  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
11823  __pyx_r = 0;
11824  __pyx_L0:;
11825  __Pyx_XDECREF(__pyx_v_struct);
11826  __Pyx_XDECREF(__pyx_v_bytesvalue);
11827  __Pyx_XGIVEREF(__pyx_r);
11828  __Pyx_TraceReturn(__pyx_r, 0);
11829  __Pyx_RefNannyFinishContext();
11830  return __pyx_r;
11831 }
11832 
11833 /* "View.MemoryView":518
11834  *
11835  * @cname('getbuffer')
11836  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
11837  * if flags & PyBUF_WRITABLE and self.view.readonly:
11838  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11839  */
11840 
11841 /* Python wrapper */
11842 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
11843 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11844  int __pyx_r;
11845  __Pyx_RefNannyDeclarations
11846  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
11847  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
11848 
11849  /* function exit code */
11850  __Pyx_RefNannyFinishContext();
11851  return __pyx_r;
11852 }
11853 
11854 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
11855  int __pyx_r;
11856  __Pyx_TraceDeclarations
11857  __Pyx_RefNannyDeclarations
11858  int __pyx_t_1;
11859  int __pyx_t_2;
11860  PyObject *__pyx_t_3 = NULL;
11861  Py_ssize_t *__pyx_t_4;
11862  char *__pyx_t_5;
11863  void *__pyx_t_6;
11864  int __pyx_t_7;
11865  Py_ssize_t __pyx_t_8;
11866  int __pyx_lineno = 0;
11867  const char *__pyx_filename = NULL;
11868  int __pyx_clineno = 0;
11869  if (__pyx_v_info == NULL) {
11870  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
11871  return -1;
11872  }
11873  __Pyx_RefNannySetupContext("__getbuffer__", 0);
11874  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
11875  __Pyx_GIVEREF(__pyx_v_info->obj);
11876  __Pyx_TraceCall("__getbuffer__", __pyx_f[1], 518, 0, __PYX_ERR(1, 518, __pyx_L1_error));
11877 
11878  /* "View.MemoryView":519
11879  * @cname('getbuffer')
11880  * def __getbuffer__(self, Py_buffer *info, int flags):
11881  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11882  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11883  *
11884  */
11885  __Pyx_TraceLine(519,0,__PYX_ERR(1, 519, __pyx_L1_error))
11886  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
11887  if (__pyx_t_2) {
11888  } else {
11889  __pyx_t_1 = __pyx_t_2;
11890  goto __pyx_L4_bool_binop_done;
11891  }
11892  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
11893  __pyx_t_1 = __pyx_t_2;
11894  __pyx_L4_bool_binop_done:;
11895  if (unlikely(__pyx_t_1)) {
11896 
11897  /* "View.MemoryView":520
11898  * def __getbuffer__(self, Py_buffer *info, int flags):
11899  * if flags & PyBUF_WRITABLE and self.view.readonly:
11900  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
11901  *
11902  * if flags & PyBUF_ND:
11903  */
11904  __Pyx_TraceLine(520,0,__PYX_ERR(1, 520, __pyx_L1_error))
11905  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 520, __pyx_L1_error)
11906  __Pyx_GOTREF(__pyx_t_3);
11907  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
11908  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
11909  __PYX_ERR(1, 520, __pyx_L1_error)
11910 
11911  /* "View.MemoryView":519
11912  * @cname('getbuffer')
11913  * def __getbuffer__(self, Py_buffer *info, int flags):
11914  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
11915  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11916  *
11917  */
11918  }
11919 
11920  /* "View.MemoryView":522
11921  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11922  *
11923  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11924  * info.shape = self.view.shape
11925  * else:
11926  */
11927  __Pyx_TraceLine(522,0,__PYX_ERR(1, 522, __pyx_L1_error))
11928  __pyx_t_1 = ((__pyx_v_flags & PyBUF_ND) != 0);
11929  if (__pyx_t_1) {
11930 
11931  /* "View.MemoryView":523
11932  *
11933  * if flags & PyBUF_ND:
11934  * info.shape = self.view.shape # <<<<<<<<<<<<<<
11935  * else:
11936  * info.shape = NULL
11937  */
11938  __Pyx_TraceLine(523,0,__PYX_ERR(1, 523, __pyx_L1_error))
11939  __pyx_t_4 = __pyx_v_self->view.shape;
11940  __pyx_v_info->shape = __pyx_t_4;
11941 
11942  /* "View.MemoryView":522
11943  * raise ValueError("Cannot create writable memory view from read-only memoryview")
11944  *
11945  * if flags & PyBUF_ND: # <<<<<<<<<<<<<<
11946  * info.shape = self.view.shape
11947  * else:
11948  */
11949  goto __pyx_L6;
11950  }
11951 
11952  /* "View.MemoryView":525
11953  * info.shape = self.view.shape
11954  * else:
11955  * info.shape = NULL # <<<<<<<<<<<<<<
11956  *
11957  * if flags & PyBUF_STRIDES:
11958  */
11959  __Pyx_TraceLine(525,0,__PYX_ERR(1, 525, __pyx_L1_error))
11960  /*else*/ {
11961  __pyx_v_info->shape = NULL;
11962  }
11963  __pyx_L6:;
11964 
11965  /* "View.MemoryView":527
11966  * info.shape = NULL
11967  *
11968  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11969  * info.strides = self.view.strides
11970  * else:
11971  */
11972  __Pyx_TraceLine(527,0,__PYX_ERR(1, 527, __pyx_L1_error))
11973  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
11974  if (__pyx_t_1) {
11975 
11976  /* "View.MemoryView":528
11977  *
11978  * if flags & PyBUF_STRIDES:
11979  * info.strides = self.view.strides # <<<<<<<<<<<<<<
11980  * else:
11981  * info.strides = NULL
11982  */
11983  __Pyx_TraceLine(528,0,__PYX_ERR(1, 528, __pyx_L1_error))
11984  __pyx_t_4 = __pyx_v_self->view.strides;
11985  __pyx_v_info->strides = __pyx_t_4;
11986 
11987  /* "View.MemoryView":527
11988  * info.shape = NULL
11989  *
11990  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
11991  * info.strides = self.view.strides
11992  * else:
11993  */
11994  goto __pyx_L7;
11995  }
11996 
11997  /* "View.MemoryView":530
11998  * info.strides = self.view.strides
11999  * else:
12000  * info.strides = NULL # <<<<<<<<<<<<<<
12001  *
12002  * if flags & PyBUF_INDIRECT:
12003  */
12004  __Pyx_TraceLine(530,0,__PYX_ERR(1, 530, __pyx_L1_error))
12005  /*else*/ {
12006  __pyx_v_info->strides = NULL;
12007  }
12008  __pyx_L7:;
12009 
12010  /* "View.MemoryView":532
12011  * info.strides = NULL
12012  *
12013  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12014  * info.suboffsets = self.view.suboffsets
12015  * else:
12016  */
12017  __Pyx_TraceLine(532,0,__PYX_ERR(1, 532, __pyx_L1_error))
12018  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12019  if (__pyx_t_1) {
12020 
12021  /* "View.MemoryView":533
12022  *
12023  * if flags & PyBUF_INDIRECT:
12024  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12025  * else:
12026  * info.suboffsets = NULL
12027  */
12028  __Pyx_TraceLine(533,0,__PYX_ERR(1, 533, __pyx_L1_error))
12029  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12030  __pyx_v_info->suboffsets = __pyx_t_4;
12031 
12032  /* "View.MemoryView":532
12033  * info.strides = NULL
12034  *
12035  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12036  * info.suboffsets = self.view.suboffsets
12037  * else:
12038  */
12039  goto __pyx_L8;
12040  }
12041 
12042  /* "View.MemoryView":535
12043  * info.suboffsets = self.view.suboffsets
12044  * else:
12045  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12046  *
12047  * if flags & PyBUF_FORMAT:
12048  */
12049  __Pyx_TraceLine(535,0,__PYX_ERR(1, 535, __pyx_L1_error))
12050  /*else*/ {
12051  __pyx_v_info->suboffsets = NULL;
12052  }
12053  __pyx_L8:;
12054 
12055  /* "View.MemoryView":537
12056  * info.suboffsets = NULL
12057  *
12058  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12059  * info.format = self.view.format
12060  * else:
12061  */
12062  __Pyx_TraceLine(537,0,__PYX_ERR(1, 537, __pyx_L1_error))
12063  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12064  if (__pyx_t_1) {
12065 
12066  /* "View.MemoryView":538
12067  *
12068  * if flags & PyBUF_FORMAT:
12069  * info.format = self.view.format # <<<<<<<<<<<<<<
12070  * else:
12071  * info.format = NULL
12072  */
12073  __Pyx_TraceLine(538,0,__PYX_ERR(1, 538, __pyx_L1_error))
12074  __pyx_t_5 = __pyx_v_self->view.format;
12075  __pyx_v_info->format = __pyx_t_5;
12076 
12077  /* "View.MemoryView":537
12078  * info.suboffsets = NULL
12079  *
12080  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12081  * info.format = self.view.format
12082  * else:
12083  */
12084  goto __pyx_L9;
12085  }
12086 
12087  /* "View.MemoryView":540
12088  * info.format = self.view.format
12089  * else:
12090  * info.format = NULL # <<<<<<<<<<<<<<
12091  *
12092  * info.buf = self.view.buf
12093  */
12094  __Pyx_TraceLine(540,0,__PYX_ERR(1, 540, __pyx_L1_error))
12095  /*else*/ {
12096  __pyx_v_info->format = NULL;
12097  }
12098  __pyx_L9:;
12099 
12100  /* "View.MemoryView":542
12101  * info.format = NULL
12102  *
12103  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12104  * info.ndim = self.view.ndim
12105  * info.itemsize = self.view.itemsize
12106  */
12107  __Pyx_TraceLine(542,0,__PYX_ERR(1, 542, __pyx_L1_error))
12108  __pyx_t_6 = __pyx_v_self->view.buf;
12109  __pyx_v_info->buf = __pyx_t_6;
12110 
12111  /* "View.MemoryView":543
12112  *
12113  * info.buf = self.view.buf
12114  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12115  * info.itemsize = self.view.itemsize
12116  * info.len = self.view.len
12117  */
12118  __Pyx_TraceLine(543,0,__PYX_ERR(1, 543, __pyx_L1_error))
12119  __pyx_t_7 = __pyx_v_self->view.ndim;
12120  __pyx_v_info->ndim = __pyx_t_7;
12121 
12122  /* "View.MemoryView":544
12123  * info.buf = self.view.buf
12124  * info.ndim = self.view.ndim
12125  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12126  * info.len = self.view.len
12127  * info.readonly = self.view.readonly
12128  */
12129  __Pyx_TraceLine(544,0,__PYX_ERR(1, 544, __pyx_L1_error))
12130  __pyx_t_8 = __pyx_v_self->view.itemsize;
12131  __pyx_v_info->itemsize = __pyx_t_8;
12132 
12133  /* "View.MemoryView":545
12134  * info.ndim = self.view.ndim
12135  * info.itemsize = self.view.itemsize
12136  * info.len = self.view.len # <<<<<<<<<<<<<<
12137  * info.readonly = self.view.readonly
12138  * info.obj = self
12139  */
12140  __Pyx_TraceLine(545,0,__PYX_ERR(1, 545, __pyx_L1_error))
12141  __pyx_t_8 = __pyx_v_self->view.len;
12142  __pyx_v_info->len = __pyx_t_8;
12143 
12144  /* "View.MemoryView":546
12145  * info.itemsize = self.view.itemsize
12146  * info.len = self.view.len
12147  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12148  * info.obj = self
12149  *
12150  */
12151  __Pyx_TraceLine(546,0,__PYX_ERR(1, 546, __pyx_L1_error))
12152  __pyx_t_1 = __pyx_v_self->view.readonly;
12153  __pyx_v_info->readonly = __pyx_t_1;
12154 
12155  /* "View.MemoryView":547
12156  * info.len = self.view.len
12157  * info.readonly = self.view.readonly
12158  * info.obj = self # <<<<<<<<<<<<<<
12159  *
12160  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12161  */
12162  __Pyx_TraceLine(547,0,__PYX_ERR(1, 547, __pyx_L1_error))
12163  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12164  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12165  __Pyx_GOTREF(__pyx_v_info->obj);
12166  __Pyx_DECREF(__pyx_v_info->obj);
12167  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12168 
12169  /* "View.MemoryView":518
12170  *
12171  * @cname('getbuffer')
12172  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12173  * if flags & PyBUF_WRITABLE and self.view.readonly:
12174  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12175  */
12176 
12177  /* function exit code */
12178  __pyx_r = 0;
12179  goto __pyx_L0;
12180  __pyx_L1_error:;
12181  __Pyx_XDECREF(__pyx_t_3);
12182  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12183  __pyx_r = -1;
12184  if (__pyx_v_info->obj != NULL) {
12185  __Pyx_GOTREF(__pyx_v_info->obj);
12186  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12187  }
12188  goto __pyx_L2;
12189  __pyx_L0:;
12190  if (__pyx_v_info->obj == Py_None) {
12191  __Pyx_GOTREF(__pyx_v_info->obj);
12192  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12193  }
12194  __pyx_L2:;
12195  __Pyx_TraceReturn(Py_None, 0);
12196  __Pyx_RefNannyFinishContext();
12197  return __pyx_r;
12198 }
12199 
12200 /* "View.MemoryView":553
12201  *
12202  * @property
12203  * def T(self): # <<<<<<<<<<<<<<
12204  * cdef _memoryviewslice result = memoryview_copy(self)
12205  * transpose_memslice(&result.from_slice)
12206  */
12207 
12208 /* Python wrapper */
12209 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12210 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12211  PyObject *__pyx_r = 0;
12212  __Pyx_RefNannyDeclarations
12213  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12214  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12215 
12216  /* function exit code */
12217  __Pyx_RefNannyFinishContext();
12218  return __pyx_r;
12219 }
12220 
12221 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12222  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12223  PyObject *__pyx_r = NULL;
12224  __Pyx_TraceDeclarations
12225  __Pyx_RefNannyDeclarations
12226  PyObject *__pyx_t_1 = NULL;
12227  int __pyx_t_2;
12228  int __pyx_lineno = 0;
12229  const char *__pyx_filename = NULL;
12230  int __pyx_clineno = 0;
12231  __Pyx_RefNannySetupContext("__get__", 0);
12232  __Pyx_TraceCall("__get__", __pyx_f[1], 553, 0, __PYX_ERR(1, 553, __pyx_L1_error));
12233 
12234  /* "View.MemoryView":554
12235  * @property
12236  * def T(self):
12237  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12238  * transpose_memslice(&result.from_slice)
12239  * return result
12240  */
12241  __Pyx_TraceLine(554,0,__PYX_ERR(1, 554, __pyx_L1_error))
12242  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 554, __pyx_L1_error)
12243  __Pyx_GOTREF(__pyx_t_1);
12244  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(1, 554, __pyx_L1_error)
12245  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12246  __pyx_t_1 = 0;
12247 
12248  /* "View.MemoryView":555
12249  * def T(self):
12250  * cdef _memoryviewslice result = memoryview_copy(self)
12251  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12252  * return result
12253  *
12254  */
12255  __Pyx_TraceLine(555,0,__PYX_ERR(1, 555, __pyx_L1_error))
12256  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 555, __pyx_L1_error)
12257 
12258  /* "View.MemoryView":556
12259  * cdef _memoryviewslice result = memoryview_copy(self)
12260  * transpose_memslice(&result.from_slice)
12261  * return result # <<<<<<<<<<<<<<
12262  *
12263  * @property
12264  */
12265  __Pyx_TraceLine(556,0,__PYX_ERR(1, 556, __pyx_L1_error))
12266  __Pyx_XDECREF(__pyx_r);
12267  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12268  __pyx_r = ((PyObject *)__pyx_v_result);
12269  goto __pyx_L0;
12270 
12271  /* "View.MemoryView":553
12272  *
12273  * @property
12274  * def T(self): # <<<<<<<<<<<<<<
12275  * cdef _memoryviewslice result = memoryview_copy(self)
12276  * transpose_memslice(&result.from_slice)
12277  */
12278 
12279  /* function exit code */
12280  __pyx_L1_error:;
12281  __Pyx_XDECREF(__pyx_t_1);
12282  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12283  __pyx_r = NULL;
12284  __pyx_L0:;
12285  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12286  __Pyx_XGIVEREF(__pyx_r);
12287  __Pyx_TraceReturn(__pyx_r, 0);
12288  __Pyx_RefNannyFinishContext();
12289  return __pyx_r;
12290 }
12291 
12292 /* "View.MemoryView":559
12293  *
12294  * @property
12295  * def base(self): # <<<<<<<<<<<<<<
12296  * return self.obj
12297  *
12298  */
12299 
12300 /* Python wrapper */
12301 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12302 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12303  PyObject *__pyx_r = 0;
12304  __Pyx_RefNannyDeclarations
12305  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12306  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12307 
12308  /* function exit code */
12309  __Pyx_RefNannyFinishContext();
12310  return __pyx_r;
12311 }
12312 
12313 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12314  PyObject *__pyx_r = NULL;
12315  __Pyx_TraceDeclarations
12316  __Pyx_RefNannyDeclarations
12317  int __pyx_lineno = 0;
12318  const char *__pyx_filename = NULL;
12319  int __pyx_clineno = 0;
12320  __Pyx_RefNannySetupContext("__get__", 0);
12321  __Pyx_TraceCall("__get__", __pyx_f[1], 559, 0, __PYX_ERR(1, 559, __pyx_L1_error));
12322 
12323  /* "View.MemoryView":560
12324  * @property
12325  * def base(self):
12326  * return self.obj # <<<<<<<<<<<<<<
12327  *
12328  * @property
12329  */
12330  __Pyx_TraceLine(560,0,__PYX_ERR(1, 560, __pyx_L1_error))
12331  __Pyx_XDECREF(__pyx_r);
12332  __Pyx_INCREF(__pyx_v_self->obj);
12333  __pyx_r = __pyx_v_self->obj;
12334  goto __pyx_L0;
12335 
12336  /* "View.MemoryView":559
12337  *
12338  * @property
12339  * def base(self): # <<<<<<<<<<<<<<
12340  * return self.obj
12341  *
12342  */
12343 
12344  /* function exit code */
12345  __pyx_L1_error:;
12346  __Pyx_AddTraceback("View.MemoryView.memoryview.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12347  __pyx_r = NULL;
12348  __pyx_L0:;
12349  __Pyx_XGIVEREF(__pyx_r);
12350  __Pyx_TraceReturn(__pyx_r, 0);
12351  __Pyx_RefNannyFinishContext();
12352  return __pyx_r;
12353 }
12354 
12355 /* "View.MemoryView":563
12356  *
12357  * @property
12358  * def shape(self): # <<<<<<<<<<<<<<
12359  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12360  *
12361  */
12362 
12363 /* Python wrapper */
12364 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
12365 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12366  PyObject *__pyx_r = 0;
12367  __Pyx_RefNannyDeclarations
12368  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12369  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12370 
12371  /* function exit code */
12372  __Pyx_RefNannyFinishContext();
12373  return __pyx_r;
12374 }
12375 
12376 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12377  Py_ssize_t __pyx_v_length;
12378  PyObject *__pyx_r = NULL;
12379  __Pyx_TraceDeclarations
12380  __Pyx_RefNannyDeclarations
12381  PyObject *__pyx_t_1 = NULL;
12382  Py_ssize_t *__pyx_t_2;
12383  Py_ssize_t *__pyx_t_3;
12384  Py_ssize_t *__pyx_t_4;
12385  PyObject *__pyx_t_5 = NULL;
12386  int __pyx_lineno = 0;
12387  const char *__pyx_filename = NULL;
12388  int __pyx_clineno = 0;
12389  __Pyx_RefNannySetupContext("__get__", 0);
12390  __Pyx_TraceCall("__get__", __pyx_f[1], 563, 0, __PYX_ERR(1, 563, __pyx_L1_error));
12391 
12392  /* "View.MemoryView":564
12393  * @property
12394  * def shape(self):
12395  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12396  *
12397  * @property
12398  */
12399  __Pyx_TraceLine(564,0,__PYX_ERR(1, 564, __pyx_L1_error))
12400  __Pyx_XDECREF(__pyx_r);
12401  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 564, __pyx_L1_error)
12402  __Pyx_GOTREF(__pyx_t_1);
12403  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12404  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12405  __pyx_t_2 = __pyx_t_4;
12406  __pyx_v_length = (__pyx_t_2[0]);
12407  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12408  __Pyx_GOTREF(__pyx_t_5);
12409  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(1, 564, __pyx_L1_error)
12410  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12411  }
12412  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 564, __pyx_L1_error)
12413  __Pyx_GOTREF(__pyx_t_5);
12414  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12415  __pyx_r = __pyx_t_5;
12416  __pyx_t_5 = 0;
12417  goto __pyx_L0;
12418 
12419  /* "View.MemoryView":563
12420  *
12421  * @property
12422  * def shape(self): # <<<<<<<<<<<<<<
12423  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12424  *
12425  */
12426 
12427  /* function exit code */
12428  __pyx_L1_error:;
12429  __Pyx_XDECREF(__pyx_t_1);
12430  __Pyx_XDECREF(__pyx_t_5);
12431  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12432  __pyx_r = NULL;
12433  __pyx_L0:;
12434  __Pyx_XGIVEREF(__pyx_r);
12435  __Pyx_TraceReturn(__pyx_r, 0);
12436  __Pyx_RefNannyFinishContext();
12437  return __pyx_r;
12438 }
12439 
12440 /* "View.MemoryView":567
12441  *
12442  * @property
12443  * def strides(self): # <<<<<<<<<<<<<<
12444  * if self.view.strides == NULL:
12445  *
12446  */
12447 
12448 /* Python wrapper */
12449 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
12450 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
12451  PyObject *__pyx_r = 0;
12452  __Pyx_RefNannyDeclarations
12453  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12454  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12455 
12456  /* function exit code */
12457  __Pyx_RefNannyFinishContext();
12458  return __pyx_r;
12459 }
12460 
12461 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12462  Py_ssize_t __pyx_v_stride;
12463  PyObject *__pyx_r = NULL;
12464  __Pyx_TraceDeclarations
12465  __Pyx_RefNannyDeclarations
12466  int __pyx_t_1;
12467  PyObject *__pyx_t_2 = NULL;
12468  Py_ssize_t *__pyx_t_3;
12469  Py_ssize_t *__pyx_t_4;
12470  Py_ssize_t *__pyx_t_5;
12471  PyObject *__pyx_t_6 = NULL;
12472  int __pyx_lineno = 0;
12473  const char *__pyx_filename = NULL;
12474  int __pyx_clineno = 0;
12475  __Pyx_RefNannySetupContext("__get__", 0);
12476  __Pyx_TraceCall("__get__", __pyx_f[1], 567, 0, __PYX_ERR(1, 567, __pyx_L1_error));
12477 
12478  /* "View.MemoryView":568
12479  * @property
12480  * def strides(self):
12481  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12482  *
12483  * raise ValueError("Buffer view does not expose strides")
12484  */
12485  __Pyx_TraceLine(568,0,__PYX_ERR(1, 568, __pyx_L1_error))
12486  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
12487  if (unlikely(__pyx_t_1)) {
12488 
12489  /* "View.MemoryView":570
12490  * if self.view.strides == NULL:
12491  *
12492  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
12493  *
12494  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
12495  */
12496  __Pyx_TraceLine(570,0,__PYX_ERR(1, 570, __pyx_L1_error))
12497  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 570, __pyx_L1_error)
12498  __Pyx_GOTREF(__pyx_t_2);
12499  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
12500  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12501  __PYX_ERR(1, 570, __pyx_L1_error)
12502 
12503  /* "View.MemoryView":568
12504  * @property
12505  * def strides(self):
12506  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
12507  *
12508  * raise ValueError("Buffer view does not expose strides")
12509  */
12510  }
12511 
12512  /* "View.MemoryView":572
12513  * raise ValueError("Buffer view does not expose strides")
12514  *
12515  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
12516  *
12517  * @property
12518  */
12519  __Pyx_TraceLine(572,0,__PYX_ERR(1, 572, __pyx_L1_error))
12520  __Pyx_XDECREF(__pyx_r);
12521  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 572, __pyx_L1_error)
12522  __Pyx_GOTREF(__pyx_t_2);
12523  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
12524  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12525  __pyx_t_3 = __pyx_t_5;
12526  __pyx_v_stride = (__pyx_t_3[0]);
12527  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12528  __Pyx_GOTREF(__pyx_t_6);
12529  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(1, 572, __pyx_L1_error)
12530  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12531  }
12532  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 572, __pyx_L1_error)
12533  __Pyx_GOTREF(__pyx_t_6);
12534  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12535  __pyx_r = __pyx_t_6;
12536  __pyx_t_6 = 0;
12537  goto __pyx_L0;
12538 
12539  /* "View.MemoryView":567
12540  *
12541  * @property
12542  * def strides(self): # <<<<<<<<<<<<<<
12543  * if self.view.strides == NULL:
12544  *
12545  */
12546 
12547  /* function exit code */
12548  __pyx_L1_error:;
12549  __Pyx_XDECREF(__pyx_t_2);
12550  __Pyx_XDECREF(__pyx_t_6);
12551  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12552  __pyx_r = NULL;
12553  __pyx_L0:;
12554  __Pyx_XGIVEREF(__pyx_r);
12555  __Pyx_TraceReturn(__pyx_r, 0);
12556  __Pyx_RefNannyFinishContext();
12557  return __pyx_r;
12558 }
12559 
12560 /* "View.MemoryView":575
12561  *
12562  * @property
12563  * def suboffsets(self): # <<<<<<<<<<<<<<
12564  * if self.view.suboffsets == NULL:
12565  * return (-1,) * self.view.ndim
12566  */
12567 
12568 /* Python wrapper */
12569 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
12570 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
12571  PyObject *__pyx_r = 0;
12572  __Pyx_RefNannyDeclarations
12573  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12574  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12575 
12576  /* function exit code */
12577  __Pyx_RefNannyFinishContext();
12578  return __pyx_r;
12579 }
12580 
12581 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12582  Py_ssize_t __pyx_v_suboffset;
12583  PyObject *__pyx_r = NULL;
12584  __Pyx_TraceDeclarations
12585  __Pyx_RefNannyDeclarations
12586  int __pyx_t_1;
12587  PyObject *__pyx_t_2 = NULL;
12588  PyObject *__pyx_t_3 = NULL;
12589  Py_ssize_t *__pyx_t_4;
12590  Py_ssize_t *__pyx_t_5;
12591  Py_ssize_t *__pyx_t_6;
12592  int __pyx_lineno = 0;
12593  const char *__pyx_filename = NULL;
12594  int __pyx_clineno = 0;
12595  __Pyx_RefNannySetupContext("__get__", 0);
12596  __Pyx_TraceCall("__get__", __pyx_f[1], 575, 0, __PYX_ERR(1, 575, __pyx_L1_error));
12597 
12598  /* "View.MemoryView":576
12599  * @property
12600  * def suboffsets(self):
12601  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12602  * return (-1,) * self.view.ndim
12603  *
12604  */
12605  __Pyx_TraceLine(576,0,__PYX_ERR(1, 576, __pyx_L1_error))
12606  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
12607  if (__pyx_t_1) {
12608 
12609  /* "View.MemoryView":577
12610  * def suboffsets(self):
12611  * if self.view.suboffsets == NULL:
12612  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
12613  *
12614  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
12615  */
12616  __Pyx_TraceLine(577,0,__PYX_ERR(1, 577, __pyx_L1_error))
12617  __Pyx_XDECREF(__pyx_r);
12618  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 577, __pyx_L1_error)
12619  __Pyx_GOTREF(__pyx_t_2);
12620  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__29, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 577, __pyx_L1_error)
12621  __Pyx_GOTREF(__pyx_t_3);
12622  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12623  __pyx_r = __pyx_t_3;
12624  __pyx_t_3 = 0;
12625  goto __pyx_L0;
12626 
12627  /* "View.MemoryView":576
12628  * @property
12629  * def suboffsets(self):
12630  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
12631  * return (-1,) * self.view.ndim
12632  *
12633  */
12634  }
12635 
12636  /* "View.MemoryView":579
12637  * return (-1,) * self.view.ndim
12638  *
12639  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
12640  *
12641  * @property
12642  */
12643  __Pyx_TraceLine(579,0,__PYX_ERR(1, 579, __pyx_L1_error))
12644  __Pyx_XDECREF(__pyx_r);
12645  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 579, __pyx_L1_error)
12646  __Pyx_GOTREF(__pyx_t_3);
12647  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
12648  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
12649  __pyx_t_4 = __pyx_t_6;
12650  __pyx_v_suboffset = (__pyx_t_4[0]);
12651  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12652  __Pyx_GOTREF(__pyx_t_2);
12653  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(1, 579, __pyx_L1_error)
12654  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12655  }
12656  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 579, __pyx_L1_error)
12657  __Pyx_GOTREF(__pyx_t_2);
12658  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12659  __pyx_r = __pyx_t_2;
12660  __pyx_t_2 = 0;
12661  goto __pyx_L0;
12662 
12663  /* "View.MemoryView":575
12664  *
12665  * @property
12666  * def suboffsets(self): # <<<<<<<<<<<<<<
12667  * if self.view.suboffsets == NULL:
12668  * return (-1,) * self.view.ndim
12669  */
12670 
12671  /* function exit code */
12672  __pyx_L1_error:;
12673  __Pyx_XDECREF(__pyx_t_2);
12674  __Pyx_XDECREF(__pyx_t_3);
12675  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12676  __pyx_r = NULL;
12677  __pyx_L0:;
12678  __Pyx_XGIVEREF(__pyx_r);
12679  __Pyx_TraceReturn(__pyx_r, 0);
12680  __Pyx_RefNannyFinishContext();
12681  return __pyx_r;
12682 }
12683 
12684 /* "View.MemoryView":582
12685  *
12686  * @property
12687  * def ndim(self): # <<<<<<<<<<<<<<
12688  * return self.view.ndim
12689  *
12690  */
12691 
12692 /* Python wrapper */
12693 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
12694 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
12695  PyObject *__pyx_r = 0;
12696  __Pyx_RefNannyDeclarations
12697  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12698  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12699 
12700  /* function exit code */
12701  __Pyx_RefNannyFinishContext();
12702  return __pyx_r;
12703 }
12704 
12705 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12706  PyObject *__pyx_r = NULL;
12707  __Pyx_TraceDeclarations
12708  __Pyx_RefNannyDeclarations
12709  PyObject *__pyx_t_1 = NULL;
12710  int __pyx_lineno = 0;
12711  const char *__pyx_filename = NULL;
12712  int __pyx_clineno = 0;
12713  __Pyx_RefNannySetupContext("__get__", 0);
12714  __Pyx_TraceCall("__get__", __pyx_f[1], 582, 0, __PYX_ERR(1, 582, __pyx_L1_error));
12715 
12716  /* "View.MemoryView":583
12717  * @property
12718  * def ndim(self):
12719  * return self.view.ndim # <<<<<<<<<<<<<<
12720  *
12721  * @property
12722  */
12723  __Pyx_TraceLine(583,0,__PYX_ERR(1, 583, __pyx_L1_error))
12724  __Pyx_XDECREF(__pyx_r);
12725  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 583, __pyx_L1_error)
12726  __Pyx_GOTREF(__pyx_t_1);
12727  __pyx_r = __pyx_t_1;
12728  __pyx_t_1 = 0;
12729  goto __pyx_L0;
12730 
12731  /* "View.MemoryView":582
12732  *
12733  * @property
12734  * def ndim(self): # <<<<<<<<<<<<<<
12735  * return self.view.ndim
12736  *
12737  */
12738 
12739  /* function exit code */
12740  __pyx_L1_error:;
12741  __Pyx_XDECREF(__pyx_t_1);
12742  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12743  __pyx_r = NULL;
12744  __pyx_L0:;
12745  __Pyx_XGIVEREF(__pyx_r);
12746  __Pyx_TraceReturn(__pyx_r, 0);
12747  __Pyx_RefNannyFinishContext();
12748  return __pyx_r;
12749 }
12750 
12751 /* "View.MemoryView":586
12752  *
12753  * @property
12754  * def itemsize(self): # <<<<<<<<<<<<<<
12755  * return self.view.itemsize
12756  *
12757  */
12758 
12759 /* Python wrapper */
12760 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
12761 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
12762  PyObject *__pyx_r = 0;
12763  __Pyx_RefNannyDeclarations
12764  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12765  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12766 
12767  /* function exit code */
12768  __Pyx_RefNannyFinishContext();
12769  return __pyx_r;
12770 }
12771 
12772 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12773  PyObject *__pyx_r = NULL;
12774  __Pyx_TraceDeclarations
12775  __Pyx_RefNannyDeclarations
12776  PyObject *__pyx_t_1 = NULL;
12777  int __pyx_lineno = 0;
12778  const char *__pyx_filename = NULL;
12779  int __pyx_clineno = 0;
12780  __Pyx_RefNannySetupContext("__get__", 0);
12781  __Pyx_TraceCall("__get__", __pyx_f[1], 586, 0, __PYX_ERR(1, 586, __pyx_L1_error));
12782 
12783  /* "View.MemoryView":587
12784  * @property
12785  * def itemsize(self):
12786  * return self.view.itemsize # <<<<<<<<<<<<<<
12787  *
12788  * @property
12789  */
12790  __Pyx_TraceLine(587,0,__PYX_ERR(1, 587, __pyx_L1_error))
12791  __Pyx_XDECREF(__pyx_r);
12792  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 587, __pyx_L1_error)
12793  __Pyx_GOTREF(__pyx_t_1);
12794  __pyx_r = __pyx_t_1;
12795  __pyx_t_1 = 0;
12796  goto __pyx_L0;
12797 
12798  /* "View.MemoryView":586
12799  *
12800  * @property
12801  * def itemsize(self): # <<<<<<<<<<<<<<
12802  * return self.view.itemsize
12803  *
12804  */
12805 
12806  /* function exit code */
12807  __pyx_L1_error:;
12808  __Pyx_XDECREF(__pyx_t_1);
12809  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12810  __pyx_r = NULL;
12811  __pyx_L0:;
12812  __Pyx_XGIVEREF(__pyx_r);
12813  __Pyx_TraceReturn(__pyx_r, 0);
12814  __Pyx_RefNannyFinishContext();
12815  return __pyx_r;
12816 }
12817 
12818 /* "View.MemoryView":590
12819  *
12820  * @property
12821  * def nbytes(self): # <<<<<<<<<<<<<<
12822  * return self.size * self.view.itemsize
12823  *
12824  */
12825 
12826 /* Python wrapper */
12827 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
12828 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
12829  PyObject *__pyx_r = 0;
12830  __Pyx_RefNannyDeclarations
12831  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12832  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12833 
12834  /* function exit code */
12835  __Pyx_RefNannyFinishContext();
12836  return __pyx_r;
12837 }
12838 
12839 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12840  PyObject *__pyx_r = NULL;
12841  __Pyx_TraceDeclarations
12842  __Pyx_RefNannyDeclarations
12843  PyObject *__pyx_t_1 = NULL;
12844  PyObject *__pyx_t_2 = NULL;
12845  PyObject *__pyx_t_3 = NULL;
12846  int __pyx_lineno = 0;
12847  const char *__pyx_filename = NULL;
12848  int __pyx_clineno = 0;
12849  __Pyx_RefNannySetupContext("__get__", 0);
12850  __Pyx_TraceCall("__get__", __pyx_f[1], 590, 0, __PYX_ERR(1, 590, __pyx_L1_error));
12851 
12852  /* "View.MemoryView":591
12853  * @property
12854  * def nbytes(self):
12855  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
12856  *
12857  * @property
12858  */
12859  __Pyx_TraceLine(591,0,__PYX_ERR(1, 591, __pyx_L1_error))
12860  __Pyx_XDECREF(__pyx_r);
12861  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 591, __pyx_L1_error)
12862  __Pyx_GOTREF(__pyx_t_1);
12863  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 591, __pyx_L1_error)
12864  __Pyx_GOTREF(__pyx_t_2);
12865  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 591, __pyx_L1_error)
12866  __Pyx_GOTREF(__pyx_t_3);
12867  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12868  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12869  __pyx_r = __pyx_t_3;
12870  __pyx_t_3 = 0;
12871  goto __pyx_L0;
12872 
12873  /* "View.MemoryView":590
12874  *
12875  * @property
12876  * def nbytes(self): # <<<<<<<<<<<<<<
12877  * return self.size * self.view.itemsize
12878  *
12879  */
12880 
12881  /* function exit code */
12882  __pyx_L1_error:;
12883  __Pyx_XDECREF(__pyx_t_1);
12884  __Pyx_XDECREF(__pyx_t_2);
12885  __Pyx_XDECREF(__pyx_t_3);
12886  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12887  __pyx_r = NULL;
12888  __pyx_L0:;
12889  __Pyx_XGIVEREF(__pyx_r);
12890  __Pyx_TraceReturn(__pyx_r, 0);
12891  __Pyx_RefNannyFinishContext();
12892  return __pyx_r;
12893 }
12894 
12895 /* "View.MemoryView":594
12896  *
12897  * @property
12898  * def size(self): # <<<<<<<<<<<<<<
12899  * if self._size is None:
12900  * result = 1
12901  */
12902 
12903 /* Python wrapper */
12904 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
12905 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
12906  PyObject *__pyx_r = 0;
12907  __Pyx_RefNannyDeclarations
12908  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12909  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12910 
12911  /* function exit code */
12912  __Pyx_RefNannyFinishContext();
12913  return __pyx_r;
12914 }
12915 
12916 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12917  PyObject *__pyx_v_result = NULL;
12918  PyObject *__pyx_v_length = NULL;
12919  PyObject *__pyx_r = NULL;
12920  __Pyx_TraceDeclarations
12921  __Pyx_RefNannyDeclarations
12922  int __pyx_t_1;
12923  int __pyx_t_2;
12924  Py_ssize_t *__pyx_t_3;
12925  Py_ssize_t *__pyx_t_4;
12926  Py_ssize_t *__pyx_t_5;
12927  PyObject *__pyx_t_6 = NULL;
12928  int __pyx_lineno = 0;
12929  const char *__pyx_filename = NULL;
12930  int __pyx_clineno = 0;
12931  __Pyx_RefNannySetupContext("__get__", 0);
12932  __Pyx_TraceCall("__get__", __pyx_f[1], 594, 0, __PYX_ERR(1, 594, __pyx_L1_error));
12933 
12934  /* "View.MemoryView":595
12935  * @property
12936  * def size(self):
12937  * if self._size is None: # <<<<<<<<<<<<<<
12938  * result = 1
12939  *
12940  */
12941  __Pyx_TraceLine(595,0,__PYX_ERR(1, 595, __pyx_L1_error))
12942  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
12943  __pyx_t_2 = (__pyx_t_1 != 0);
12944  if (__pyx_t_2) {
12945 
12946  /* "View.MemoryView":596
12947  * def size(self):
12948  * if self._size is None:
12949  * result = 1 # <<<<<<<<<<<<<<
12950  *
12951  * for length in self.view.shape[:self.view.ndim]:
12952  */
12953  __Pyx_TraceLine(596,0,__PYX_ERR(1, 596, __pyx_L1_error))
12954  __Pyx_INCREF(__pyx_int_1);
12955  __pyx_v_result = __pyx_int_1;
12956 
12957  /* "View.MemoryView":598
12958  * result = 1
12959  *
12960  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
12961  * result *= length
12962  *
12963  */
12964  __Pyx_TraceLine(598,0,__PYX_ERR(1, 598, __pyx_L1_error))
12965  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12966  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
12967  __pyx_t_3 = __pyx_t_5;
12968  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 598, __pyx_L1_error)
12969  __Pyx_GOTREF(__pyx_t_6);
12970  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
12971  __pyx_t_6 = 0;
12972 
12973  /* "View.MemoryView":599
12974  *
12975  * for length in self.view.shape[:self.view.ndim]:
12976  * result *= length # <<<<<<<<<<<<<<
12977  *
12978  * self._size = result
12979  */
12980  __Pyx_TraceLine(599,0,__PYX_ERR(1, 599, __pyx_L1_error))
12981  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 599, __pyx_L1_error)
12982  __Pyx_GOTREF(__pyx_t_6);
12983  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
12984  __pyx_t_6 = 0;
12985  }
12986 
12987  /* "View.MemoryView":601
12988  * result *= length
12989  *
12990  * self._size = result # <<<<<<<<<<<<<<
12991  *
12992  * return self._size
12993  */
12994  __Pyx_TraceLine(601,0,__PYX_ERR(1, 601, __pyx_L1_error))
12995  __Pyx_INCREF(__pyx_v_result);
12996  __Pyx_GIVEREF(__pyx_v_result);
12997  __Pyx_GOTREF(__pyx_v_self->_size);
12998  __Pyx_DECREF(__pyx_v_self->_size);
12999  __pyx_v_self->_size = __pyx_v_result;
13000 
13001  /* "View.MemoryView":595
13002  * @property
13003  * def size(self):
13004  * if self._size is None: # <<<<<<<<<<<<<<
13005  * result = 1
13006  *
13007  */
13008  }
13009 
13010  /* "View.MemoryView":603
13011  * self._size = result
13012  *
13013  * return self._size # <<<<<<<<<<<<<<
13014  *
13015  * def __len__(self):
13016  */
13017  __Pyx_TraceLine(603,0,__PYX_ERR(1, 603, __pyx_L1_error))
13018  __Pyx_XDECREF(__pyx_r);
13019  __Pyx_INCREF(__pyx_v_self->_size);
13020  __pyx_r = __pyx_v_self->_size;
13021  goto __pyx_L0;
13022 
13023  /* "View.MemoryView":594
13024  *
13025  * @property
13026  * def size(self): # <<<<<<<<<<<<<<
13027  * if self._size is None:
13028  * result = 1
13029  */
13030 
13031  /* function exit code */
13032  __pyx_L1_error:;
13033  __Pyx_XDECREF(__pyx_t_6);
13034  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13035  __pyx_r = NULL;
13036  __pyx_L0:;
13037  __Pyx_XDECREF(__pyx_v_result);
13038  __Pyx_XDECREF(__pyx_v_length);
13039  __Pyx_XGIVEREF(__pyx_r);
13040  __Pyx_TraceReturn(__pyx_r, 0);
13041  __Pyx_RefNannyFinishContext();
13042  return __pyx_r;
13043 }
13044 
13045 /* "View.MemoryView":605
13046  * return self._size
13047  *
13048  * def __len__(self): # <<<<<<<<<<<<<<
13049  * if self.view.ndim >= 1:
13050  * return self.view.shape[0]
13051  */
13052 
13053 /* Python wrapper */
13054 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13055 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13056  Py_ssize_t __pyx_r;
13057  __Pyx_RefNannyDeclarations
13058  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13059  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13060 
13061  /* function exit code */
13062  __Pyx_RefNannyFinishContext();
13063  return __pyx_r;
13064 }
13065 
13066 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13067  Py_ssize_t __pyx_r;
13068  __Pyx_TraceDeclarations
13069  __Pyx_RefNannyDeclarations
13070  int __pyx_t_1;
13071  int __pyx_lineno = 0;
13072  const char *__pyx_filename = NULL;
13073  int __pyx_clineno = 0;
13074  __Pyx_RefNannySetupContext("__len__", 0);
13075  __Pyx_TraceCall("__len__", __pyx_f[1], 605, 0, __PYX_ERR(1, 605, __pyx_L1_error));
13076 
13077  /* "View.MemoryView":606
13078  *
13079  * def __len__(self):
13080  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13081  * return self.view.shape[0]
13082  *
13083  */
13084  __Pyx_TraceLine(606,0,__PYX_ERR(1, 606, __pyx_L1_error))
13085  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13086  if (__pyx_t_1) {
13087 
13088  /* "View.MemoryView":607
13089  * def __len__(self):
13090  * if self.view.ndim >= 1:
13091  * return self.view.shape[0] # <<<<<<<<<<<<<<
13092  *
13093  * return 0
13094  */
13095  __Pyx_TraceLine(607,0,__PYX_ERR(1, 607, __pyx_L1_error))
13096  __pyx_r = (__pyx_v_self->view.shape[0]);
13097  goto __pyx_L0;
13098 
13099  /* "View.MemoryView":606
13100  *
13101  * def __len__(self):
13102  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13103  * return self.view.shape[0]
13104  *
13105  */
13106  }
13107 
13108  /* "View.MemoryView":609
13109  * return self.view.shape[0]
13110  *
13111  * return 0 # <<<<<<<<<<<<<<
13112  *
13113  * def __repr__(self):
13114  */
13115  __Pyx_TraceLine(609,0,__PYX_ERR(1, 609, __pyx_L1_error))
13116  __pyx_r = 0;
13117  goto __pyx_L0;
13118 
13119  /* "View.MemoryView":605
13120  * return self._size
13121  *
13122  * def __len__(self): # <<<<<<<<<<<<<<
13123  * if self.view.ndim >= 1:
13124  * return self.view.shape[0]
13125  */
13126 
13127  /* function exit code */
13128  __pyx_L1_error:;
13129  __Pyx_AddTraceback("View.MemoryView.memoryview.__len__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13130  __pyx_r = -1;
13131  __pyx_L0:;
13132  __Pyx_TraceReturn(Py_None, 0);
13133  __Pyx_RefNannyFinishContext();
13134  return __pyx_r;
13135 }
13136 
13137 /* "View.MemoryView":611
13138  * return 0
13139  *
13140  * def __repr__(self): # <<<<<<<<<<<<<<
13141  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13142  * id(self))
13143  */
13144 
13145 /* Python wrapper */
13146 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13147 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13148  PyObject *__pyx_r = 0;
13149  __Pyx_RefNannyDeclarations
13150  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13151  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13152 
13153  /* function exit code */
13154  __Pyx_RefNannyFinishContext();
13155  return __pyx_r;
13156 }
13157 
13158 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13159  PyObject *__pyx_r = NULL;
13160  __Pyx_TraceDeclarations
13161  __Pyx_RefNannyDeclarations
13162  PyObject *__pyx_t_1 = NULL;
13163  PyObject *__pyx_t_2 = NULL;
13164  PyObject *__pyx_t_3 = NULL;
13165  int __pyx_lineno = 0;
13166  const char *__pyx_filename = NULL;
13167  int __pyx_clineno = 0;
13168  __Pyx_RefNannySetupContext("__repr__", 0);
13169  __Pyx_TraceCall("__repr__", __pyx_f[1], 611, 0, __PYX_ERR(1, 611, __pyx_L1_error));
13170 
13171  /* "View.MemoryView":612
13172  *
13173  * def __repr__(self):
13174  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13175  * id(self))
13176  *
13177  */
13178  __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
13179  __Pyx_XDECREF(__pyx_r);
13180  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13181  __Pyx_GOTREF(__pyx_t_1);
13182  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13183  __Pyx_GOTREF(__pyx_t_2);
13184  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13185  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 612, __pyx_L1_error)
13186  __Pyx_GOTREF(__pyx_t_1);
13187  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13188 
13189  /* "View.MemoryView":613
13190  * def __repr__(self):
13191  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13192  * id(self)) # <<<<<<<<<<<<<<
13193  *
13194  * def __str__(self):
13195  */
13196  __Pyx_TraceLine(613,0,__PYX_ERR(1, 613, __pyx_L1_error))
13197  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 613, __pyx_L1_error)
13198  __Pyx_GOTREF(__pyx_t_2);
13199 
13200  /* "View.MemoryView":612
13201  *
13202  * def __repr__(self):
13203  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13204  * id(self))
13205  *
13206  */
13207  __Pyx_TraceLine(612,0,__PYX_ERR(1, 612, __pyx_L1_error))
13208  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 612, __pyx_L1_error)
13209  __Pyx_GOTREF(__pyx_t_3);
13210  __Pyx_GIVEREF(__pyx_t_1);
13211  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13212  __Pyx_GIVEREF(__pyx_t_2);
13213  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13214  __pyx_t_1 = 0;
13215  __pyx_t_2 = 0;
13216  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 612, __pyx_L1_error)
13217  __Pyx_GOTREF(__pyx_t_2);
13218  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13219  __pyx_r = __pyx_t_2;
13220  __pyx_t_2 = 0;
13221  goto __pyx_L0;
13222 
13223  /* "View.MemoryView":611
13224  * return 0
13225  *
13226  * def __repr__(self): # <<<<<<<<<<<<<<
13227  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13228  * id(self))
13229  */
13230 
13231  /* function exit code */
13232  __pyx_L1_error:;
13233  __Pyx_XDECREF(__pyx_t_1);
13234  __Pyx_XDECREF(__pyx_t_2);
13235  __Pyx_XDECREF(__pyx_t_3);
13236  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13237  __pyx_r = NULL;
13238  __pyx_L0:;
13239  __Pyx_XGIVEREF(__pyx_r);
13240  __Pyx_TraceReturn(__pyx_r, 0);
13241  __Pyx_RefNannyFinishContext();
13242  return __pyx_r;
13243 }
13244 
13245 /* "View.MemoryView":615
13246  * id(self))
13247  *
13248  * def __str__(self): # <<<<<<<<<<<<<<
13249  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13250  *
13251  */
13252 
13253 /* Python wrapper */
13254 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13255 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13256  PyObject *__pyx_r = 0;
13257  __Pyx_RefNannyDeclarations
13258  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13259  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13260 
13261  /* function exit code */
13262  __Pyx_RefNannyFinishContext();
13263  return __pyx_r;
13264 }
13265 
13266 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13267  PyObject *__pyx_r = NULL;
13268  __Pyx_TraceDeclarations
13269  __Pyx_RefNannyDeclarations
13270  PyObject *__pyx_t_1 = NULL;
13271  PyObject *__pyx_t_2 = NULL;
13272  int __pyx_lineno = 0;
13273  const char *__pyx_filename = NULL;
13274  int __pyx_clineno = 0;
13275  __Pyx_RefNannySetupContext("__str__", 0);
13276  __Pyx_TraceCall("__str__", __pyx_f[1], 615, 0, __PYX_ERR(1, 615, __pyx_L1_error));
13277 
13278  /* "View.MemoryView":616
13279  *
13280  * def __str__(self):
13281  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13282  *
13283  *
13284  */
13285  __Pyx_TraceLine(616,0,__PYX_ERR(1, 616, __pyx_L1_error))
13286  __Pyx_XDECREF(__pyx_r);
13287  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13288  __Pyx_GOTREF(__pyx_t_1);
13289  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13290  __Pyx_GOTREF(__pyx_t_2);
13291  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13292  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13293  __Pyx_GOTREF(__pyx_t_1);
13294  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13295  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 616, __pyx_L1_error)
13296  __Pyx_GOTREF(__pyx_t_2);
13297  __Pyx_GIVEREF(__pyx_t_1);
13298  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13299  __pyx_t_1 = 0;
13300  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 616, __pyx_L1_error)
13301  __Pyx_GOTREF(__pyx_t_1);
13302  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13303  __pyx_r = __pyx_t_1;
13304  __pyx_t_1 = 0;
13305  goto __pyx_L0;
13306 
13307  /* "View.MemoryView":615
13308  * id(self))
13309  *
13310  * def __str__(self): # <<<<<<<<<<<<<<
13311  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13312  *
13313  */
13314 
13315  /* function exit code */
13316  __pyx_L1_error:;
13317  __Pyx_XDECREF(__pyx_t_1);
13318  __Pyx_XDECREF(__pyx_t_2);
13319  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13320  __pyx_r = NULL;
13321  __pyx_L0:;
13322  __Pyx_XGIVEREF(__pyx_r);
13323  __Pyx_TraceReturn(__pyx_r, 0);
13324  __Pyx_RefNannyFinishContext();
13325  return __pyx_r;
13326 }
13327 
13328 /* "View.MemoryView":619
13329  *
13330  *
13331  * def is_c_contig(self): # <<<<<<<<<<<<<<
13332  * cdef __Pyx_memviewslice *mslice
13333  * cdef __Pyx_memviewslice tmp
13334  */
13335 
13336 /* Python wrapper */
13337 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13338 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13339 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13340  PyObject *__pyx_r = 0;
13341  __Pyx_RefNannyDeclarations
13342  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13343  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13344 
13345  /* function exit code */
13346  __Pyx_RefNannyFinishContext();
13347  return __pyx_r;
13348 }
13349 
13350 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13351  __Pyx_memviewslice *__pyx_v_mslice;
13352  __Pyx_memviewslice __pyx_v_tmp;
13353  PyObject *__pyx_r = NULL;
13354  __Pyx_TraceDeclarations
13355  __Pyx_RefNannyDeclarations
13356  __Pyx_memviewslice *__pyx_t_1;
13357  PyObject *__pyx_t_2 = NULL;
13358  int __pyx_lineno = 0;
13359  const char *__pyx_filename = NULL;
13360  int __pyx_clineno = 0;
13361  __Pyx_RefNannySetupContext("is_c_contig", 0);
13362  __Pyx_TraceCall("is_c_contig", __pyx_f[1], 619, 0, __PYX_ERR(1, 619, __pyx_L1_error));
13363 
13364  /* "View.MemoryView":622
13365  * cdef __Pyx_memviewslice *mslice
13366  * cdef __Pyx_memviewslice tmp
13367  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13368  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13369  *
13370  */
13371  __Pyx_TraceLine(622,0,__PYX_ERR(1, 622, __pyx_L1_error))
13372  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 622, __pyx_L1_error)
13373  __pyx_v_mslice = __pyx_t_1;
13374 
13375  /* "View.MemoryView":623
13376  * cdef __Pyx_memviewslice tmp
13377  * mslice = get_slice_from_memview(self, &tmp)
13378  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13379  *
13380  * def is_f_contig(self):
13381  */
13382  __Pyx_TraceLine(623,0,__PYX_ERR(1, 623, __pyx_L1_error))
13383  __Pyx_XDECREF(__pyx_r);
13384  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 623, __pyx_L1_error)
13385  __Pyx_GOTREF(__pyx_t_2);
13386  __pyx_r = __pyx_t_2;
13387  __pyx_t_2 = 0;
13388  goto __pyx_L0;
13389 
13390  /* "View.MemoryView":619
13391  *
13392  *
13393  * def is_c_contig(self): # <<<<<<<<<<<<<<
13394  * cdef __Pyx_memviewslice *mslice
13395  * cdef __Pyx_memviewslice tmp
13396  */
13397 
13398  /* function exit code */
13399  __pyx_L1_error:;
13400  __Pyx_XDECREF(__pyx_t_2);
13401  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13402  __pyx_r = NULL;
13403  __pyx_L0:;
13404  __Pyx_XGIVEREF(__pyx_r);
13405  __Pyx_TraceReturn(__pyx_r, 0);
13406  __Pyx_RefNannyFinishContext();
13407  return __pyx_r;
13408 }
13409 
13410 /* "View.MemoryView":625
13411  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13412  *
13413  * def is_f_contig(self): # <<<<<<<<<<<<<<
13414  * cdef __Pyx_memviewslice *mslice
13415  * cdef __Pyx_memviewslice tmp
13416  */
13417 
13418 /* Python wrapper */
13419 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13420 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13421 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13422  PyObject *__pyx_r = 0;
13423  __Pyx_RefNannyDeclarations
13424  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13425  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13426 
13427  /* function exit code */
13428  __Pyx_RefNannyFinishContext();
13429  return __pyx_r;
13430 }
13431 
13432 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13433  __Pyx_memviewslice *__pyx_v_mslice;
13434  __Pyx_memviewslice __pyx_v_tmp;
13435  PyObject *__pyx_r = NULL;
13436  __Pyx_TraceDeclarations
13437  __Pyx_RefNannyDeclarations
13438  __Pyx_memviewslice *__pyx_t_1;
13439  PyObject *__pyx_t_2 = NULL;
13440  int __pyx_lineno = 0;
13441  const char *__pyx_filename = NULL;
13442  int __pyx_clineno = 0;
13443  __Pyx_RefNannySetupContext("is_f_contig", 0);
13444  __Pyx_TraceCall("is_f_contig", __pyx_f[1], 625, 0, __PYX_ERR(1, 625, __pyx_L1_error));
13445 
13446  /* "View.MemoryView":628
13447  * cdef __Pyx_memviewslice *mslice
13448  * cdef __Pyx_memviewslice tmp
13449  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13450  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13451  *
13452  */
13453  __Pyx_TraceLine(628,0,__PYX_ERR(1, 628, __pyx_L1_error))
13454  __pyx_t_1 = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp)); if (unlikely(__pyx_t_1 == ((__Pyx_memviewslice *)NULL))) __PYX_ERR(1, 628, __pyx_L1_error)
13455  __pyx_v_mslice = __pyx_t_1;
13456 
13457  /* "View.MemoryView":629
13458  * cdef __Pyx_memviewslice tmp
13459  * mslice = get_slice_from_memview(self, &tmp)
13460  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13461  *
13462  * def copy(self):
13463  */
13464  __Pyx_TraceLine(629,0,__PYX_ERR(1, 629, __pyx_L1_error))
13465  __Pyx_XDECREF(__pyx_r);
13466  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 629, __pyx_L1_error)
13467  __Pyx_GOTREF(__pyx_t_2);
13468  __pyx_r = __pyx_t_2;
13469  __pyx_t_2 = 0;
13470  goto __pyx_L0;
13471 
13472  /* "View.MemoryView":625
13473  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13474  *
13475  * def is_f_contig(self): # <<<<<<<<<<<<<<
13476  * cdef __Pyx_memviewslice *mslice
13477  * cdef __Pyx_memviewslice tmp
13478  */
13479 
13480  /* function exit code */
13481  __pyx_L1_error:;
13482  __Pyx_XDECREF(__pyx_t_2);
13483  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13484  __pyx_r = NULL;
13485  __pyx_L0:;
13486  __Pyx_XGIVEREF(__pyx_r);
13487  __Pyx_TraceReturn(__pyx_r, 0);
13488  __Pyx_RefNannyFinishContext();
13489  return __pyx_r;
13490 }
13491 
13492 /* "View.MemoryView":631
13493  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13494  *
13495  * def copy(self): # <<<<<<<<<<<<<<
13496  * cdef __Pyx_memviewslice mslice
13497  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13498  */
13499 
13500 /* Python wrapper */
13501 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13502 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13503 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13504  PyObject *__pyx_r = 0;
13505  __Pyx_RefNannyDeclarations
13506  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13507  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13508 
13509  /* function exit code */
13510  __Pyx_RefNannyFinishContext();
13511  return __pyx_r;
13512 }
13513 
13514 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13515  __Pyx_memviewslice __pyx_v_mslice;
13516  int __pyx_v_flags;
13517  PyObject *__pyx_r = NULL;
13518  __Pyx_TraceDeclarations
13519  __Pyx_RefNannyDeclarations
13520  __Pyx_memviewslice __pyx_t_1;
13521  PyObject *__pyx_t_2 = NULL;
13522  int __pyx_lineno = 0;
13523  const char *__pyx_filename = NULL;
13524  int __pyx_clineno = 0;
13525  __Pyx_RefNannySetupContext("copy", 0);
13526  __Pyx_TraceCall("copy", __pyx_f[1], 631, 0, __PYX_ERR(1, 631, __pyx_L1_error));
13527 
13528  /* "View.MemoryView":633
13529  * def copy(self):
13530  * cdef __Pyx_memviewslice mslice
13531  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13532  *
13533  * slice_copy(self, &mslice)
13534  */
13535  __Pyx_TraceLine(633,0,__PYX_ERR(1, 633, __pyx_L1_error))
13536  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13537 
13538  /* "View.MemoryView":635
13539  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13540  *
13541  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13542  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13543  * self.view.itemsize,
13544  */
13545  __Pyx_TraceLine(635,0,__PYX_ERR(1, 635, __pyx_L1_error))
13546  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
13547 
13548  /* "View.MemoryView":636
13549  *
13550  * slice_copy(self, &mslice)
13551  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
13552  * self.view.itemsize,
13553  * flags|PyBUF_C_CONTIGUOUS,
13554  */
13555  __Pyx_TraceLine(636,0,__PYX_ERR(1, 636, __pyx_L1_error))
13556  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 636, __pyx_L1_error)
13557  __pyx_v_mslice = __pyx_t_1;
13558 
13559  /* "View.MemoryView":641
13560  * self.dtype_is_object)
13561  *
13562  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
13563  *
13564  * def copy_fortran(self):
13565  */
13566  __Pyx_TraceLine(641,0,__PYX_ERR(1, 641, __pyx_L1_error))
13567  __Pyx_XDECREF(__pyx_r);
13568  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 641, __pyx_L1_error)
13569  __Pyx_GOTREF(__pyx_t_2);
13570  __pyx_r = __pyx_t_2;
13571  __pyx_t_2 = 0;
13572  goto __pyx_L0;
13573 
13574  /* "View.MemoryView":631
13575  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13576  *
13577  * def copy(self): # <<<<<<<<<<<<<<
13578  * cdef __Pyx_memviewslice mslice
13579  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13580  */
13581 
13582  /* function exit code */
13583  __pyx_L1_error:;
13584  __Pyx_XDECREF(__pyx_t_2);
13585  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
13586  __pyx_r = NULL;
13587  __pyx_L0:;
13588  __Pyx_XGIVEREF(__pyx_r);
13589  __Pyx_TraceReturn(__pyx_r, 0);
13590  __Pyx_RefNannyFinishContext();
13591  return __pyx_r;
13592 }
13593 
13594 /* "View.MemoryView":643
13595  * return memoryview_copy_from_slice(self, &mslice)
13596  *
13597  * def copy_fortran(self): # <<<<<<<<<<<<<<
13598  * cdef __Pyx_memviewslice src, dst
13599  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13600  */
13601 
13602 /* Python wrapper */
13603 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13604 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
13605 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13606  PyObject *__pyx_r = 0;
13607  __Pyx_RefNannyDeclarations
13608  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
13609  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
13610 
13611  /* function exit code */
13612  __Pyx_RefNannyFinishContext();
13613  return __pyx_r;
13614 }
13615 
13616 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
13617  __Pyx_memviewslice __pyx_v_src;
13618  __Pyx_memviewslice __pyx_v_dst;
13619  int __pyx_v_flags;
13620  PyObject *__pyx_r = NULL;
13621  __Pyx_TraceDeclarations
13622  __Pyx_RefNannyDeclarations
13623  __Pyx_memviewslice __pyx_t_1;
13624  PyObject *__pyx_t_2 = NULL;
13625  int __pyx_lineno = 0;
13626  const char *__pyx_filename = NULL;
13627  int __pyx_clineno = 0;
13628  __Pyx_RefNannySetupContext("copy_fortran", 0);
13629  __Pyx_TraceCall("copy_fortran", __pyx_f[1], 643, 0, __PYX_ERR(1, 643, __pyx_L1_error));
13630 
13631  /* "View.MemoryView":645
13632  * def copy_fortran(self):
13633  * cdef __Pyx_memviewslice src, dst
13634  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
13635  *
13636  * slice_copy(self, &src)
13637  */
13638  __Pyx_TraceLine(645,0,__PYX_ERR(1, 645, __pyx_L1_error))
13639  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
13640 
13641  /* "View.MemoryView":647
13642  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13643  *
13644  * slice_copy(self, &src) # <<<<<<<<<<<<<<
13645  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
13646  * self.view.itemsize,
13647  */
13648  __Pyx_TraceLine(647,0,__PYX_ERR(1, 647, __pyx_L1_error))
13649  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
13650 
13651  /* "View.MemoryView":648
13652  *
13653  * slice_copy(self, &src)
13654  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
13655  * self.view.itemsize,
13656  * flags|PyBUF_F_CONTIGUOUS,
13657  */
13658  __Pyx_TraceLine(648,0,__PYX_ERR(1, 648, __pyx_L1_error))
13659  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 648, __pyx_L1_error)
13660  __pyx_v_dst = __pyx_t_1;
13661 
13662  /* "View.MemoryView":653
13663  * self.dtype_is_object)
13664  *
13665  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
13666  *
13667  *
13668  */
13669  __Pyx_TraceLine(653,0,__PYX_ERR(1, 653, __pyx_L1_error))
13670  __Pyx_XDECREF(__pyx_r);
13671  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 653, __pyx_L1_error)
13672  __Pyx_GOTREF(__pyx_t_2);
13673  __pyx_r = __pyx_t_2;
13674  __pyx_t_2 = 0;
13675  goto __pyx_L0;
13676 
13677  /* "View.MemoryView":643
13678  * return memoryview_copy_from_slice(self, &mslice)
13679  *
13680  * def copy_fortran(self): # <<<<<<<<<<<<<<
13681  * cdef __Pyx_memviewslice src, dst
13682  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
13683  */
13684 
13685  /* function exit code */
13686  __pyx_L1_error:;
13687  __Pyx_XDECREF(__pyx_t_2);
13688  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
13689  __pyx_r = NULL;
13690  __pyx_L0:;
13691  __Pyx_XGIVEREF(__pyx_r);
13692  __Pyx_TraceReturn(__pyx_r, 0);
13693  __Pyx_RefNannyFinishContext();
13694  return __pyx_r;
13695 }
13696 
13697 /* "(tree fragment)":1
13698  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13699  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13700  * def __setstate_cython__(self, __pyx_state):
13701  */
13702 
13703 /* Python wrapper */
13704 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13705 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
13706 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13707  PyObject *__pyx_r = 0;
13708  __Pyx_RefNannyDeclarations
13709  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
13710  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13711 
13712  /* function exit code */
13713  __Pyx_RefNannyFinishContext();
13714  return __pyx_r;
13715 }
13716 
13717 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
13718  PyObject *__pyx_r = NULL;
13719  __Pyx_TraceDeclarations
13720  __Pyx_RefNannyDeclarations
13721  PyObject *__pyx_t_1 = NULL;
13722  int __pyx_lineno = 0;
13723  const char *__pyx_filename = NULL;
13724  int __pyx_clineno = 0;
13725  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
13726  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
13727 
13728  /* "(tree fragment)":2
13729  * def __reduce_cython__(self):
13730  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13731  * def __setstate_cython__(self, __pyx_state):
13732  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13733  */
13734  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
13735  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
13736  __Pyx_GOTREF(__pyx_t_1);
13737  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13738  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13739  __PYX_ERR(1, 2, __pyx_L1_error)
13740 
13741  /* "(tree fragment)":1
13742  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
13743  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13744  * def __setstate_cython__(self, __pyx_state):
13745  */
13746 
13747  /* function exit code */
13748  __pyx_L1_error:;
13749  __Pyx_XDECREF(__pyx_t_1);
13750  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13751  __pyx_r = NULL;
13752  __Pyx_XGIVEREF(__pyx_r);
13753  __Pyx_TraceReturn(__pyx_r, 0);
13754  __Pyx_RefNannyFinishContext();
13755  return __pyx_r;
13756 }
13757 
13758 /* "(tree fragment)":3
13759  * def __reduce_cython__(self):
13760  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13761  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13762  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13763  */
13764 
13765 /* Python wrapper */
13766 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
13767 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
13768 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
13769  PyObject *__pyx_r = 0;
13770  __Pyx_RefNannyDeclarations
13771  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
13772  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
13773 
13774  /* function exit code */
13775  __Pyx_RefNannyFinishContext();
13776  return __pyx_r;
13777 }
13778 
13779 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
13780  PyObject *__pyx_r = NULL;
13781  __Pyx_TraceDeclarations
13782  __Pyx_RefNannyDeclarations
13783  PyObject *__pyx_t_1 = NULL;
13784  int __pyx_lineno = 0;
13785  const char *__pyx_filename = NULL;
13786  int __pyx_clineno = 0;
13787  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
13788  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
13789 
13790  /* "(tree fragment)":4
13791  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13792  * def __setstate_cython__(self, __pyx_state):
13793  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
13794  */
13795  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
13796  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
13797  __Pyx_GOTREF(__pyx_t_1);
13798  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
13799  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13800  __PYX_ERR(1, 4, __pyx_L1_error)
13801 
13802  /* "(tree fragment)":3
13803  * def __reduce_cython__(self):
13804  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13805  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
13806  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
13807  */
13808 
13809  /* function exit code */
13810  __pyx_L1_error:;
13811  __Pyx_XDECREF(__pyx_t_1);
13812  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13813  __pyx_r = NULL;
13814  __Pyx_XGIVEREF(__pyx_r);
13815  __Pyx_TraceReturn(__pyx_r, 0);
13816  __Pyx_RefNannyFinishContext();
13817  return __pyx_r;
13818 }
13819 
13820 /* "View.MemoryView":657
13821  *
13822  * @cname('__pyx_memoryview_new')
13823  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13824  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13825  * result.typeinfo = typeinfo
13826  */
13827 
13828 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
13829  struct __pyx_memoryview_obj *__pyx_v_result = 0;
13830  PyObject *__pyx_r = NULL;
13831  __Pyx_TraceDeclarations
13832  __Pyx_RefNannyDeclarations
13833  PyObject *__pyx_t_1 = NULL;
13834  PyObject *__pyx_t_2 = NULL;
13835  PyObject *__pyx_t_3 = NULL;
13836  int __pyx_lineno = 0;
13837  const char *__pyx_filename = NULL;
13838  int __pyx_clineno = 0;
13839  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
13840  __Pyx_TraceCall("memoryview_cwrapper", __pyx_f[1], 657, 0, __PYX_ERR(1, 657, __pyx_L1_error));
13841 
13842  /* "View.MemoryView":658
13843  * @cname('__pyx_memoryview_new')
13844  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13845  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
13846  * result.typeinfo = typeinfo
13847  * return result
13848  */
13849  __Pyx_TraceLine(658,0,__PYX_ERR(1, 658, __pyx_L1_error))
13850  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 658, __pyx_L1_error)
13851  __Pyx_GOTREF(__pyx_t_1);
13852  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13853  __Pyx_GOTREF(__pyx_t_2);
13854  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 658, __pyx_L1_error)
13855  __Pyx_GOTREF(__pyx_t_3);
13856  __Pyx_INCREF(__pyx_v_o);
13857  __Pyx_GIVEREF(__pyx_v_o);
13858  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
13859  __Pyx_GIVEREF(__pyx_t_1);
13860  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
13861  __Pyx_GIVEREF(__pyx_t_2);
13862  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
13863  __pyx_t_1 = 0;
13864  __pyx_t_2 = 0;
13865  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 658, __pyx_L1_error)
13866  __Pyx_GOTREF(__pyx_t_2);
13867  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13868  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
13869  __pyx_t_2 = 0;
13870 
13871  /* "View.MemoryView":659
13872  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
13873  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13874  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
13875  * return result
13876  *
13877  */
13878  __Pyx_TraceLine(659,0,__PYX_ERR(1, 659, __pyx_L1_error))
13879  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
13880 
13881  /* "View.MemoryView":660
13882  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13883  * result.typeinfo = typeinfo
13884  * return result # <<<<<<<<<<<<<<
13885  *
13886  * @cname('__pyx_memoryview_check')
13887  */
13888  __Pyx_TraceLine(660,0,__PYX_ERR(1, 660, __pyx_L1_error))
13889  __Pyx_XDECREF(__pyx_r);
13890  __Pyx_INCREF(((PyObject *)__pyx_v_result));
13891  __pyx_r = ((PyObject *)__pyx_v_result);
13892  goto __pyx_L0;
13893 
13894  /* "View.MemoryView":657
13895  *
13896  * @cname('__pyx_memoryview_new')
13897  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
13898  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
13899  * result.typeinfo = typeinfo
13900  */
13901 
13902  /* function exit code */
13903  __pyx_L1_error:;
13904  __Pyx_XDECREF(__pyx_t_1);
13905  __Pyx_XDECREF(__pyx_t_2);
13906  __Pyx_XDECREF(__pyx_t_3);
13907  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
13908  __pyx_r = 0;
13909  __pyx_L0:;
13910  __Pyx_XDECREF((PyObject *)__pyx_v_result);
13911  __Pyx_XGIVEREF(__pyx_r);
13912  __Pyx_TraceReturn(__pyx_r, 0);
13913  __Pyx_RefNannyFinishContext();
13914  return __pyx_r;
13915 }
13916 
13917 /* "View.MemoryView":663
13918  *
13919  * @cname('__pyx_memoryview_check')
13920  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13921  * return isinstance(o, memoryview)
13922  *
13923  */
13924 
13925 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
13926  int __pyx_r;
13927  __Pyx_TraceDeclarations
13928  __Pyx_RefNannyDeclarations
13929  int __pyx_t_1;
13930  int __pyx_lineno = 0;
13931  const char *__pyx_filename = NULL;
13932  int __pyx_clineno = 0;
13933  __Pyx_RefNannySetupContext("memoryview_check", 0);
13934  __Pyx_TraceCall("memoryview_check", __pyx_f[1], 663, 0, __PYX_ERR(1, 663, __pyx_L1_error));
13935 
13936  /* "View.MemoryView":664
13937  * @cname('__pyx_memoryview_check')
13938  * cdef inline bint memoryview_check(object o):
13939  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
13940  *
13941  * cdef tuple _unellipsify(object index, int ndim):
13942  */
13943  __Pyx_TraceLine(664,0,__PYX_ERR(1, 664, __pyx_L1_error))
13944  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
13945  __pyx_r = __pyx_t_1;
13946  goto __pyx_L0;
13947 
13948  /* "View.MemoryView":663
13949  *
13950  * @cname('__pyx_memoryview_check')
13951  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
13952  * return isinstance(o, memoryview)
13953  *
13954  */
13955 
13956  /* function exit code */
13957  __pyx_L1_error:;
13958  __Pyx_WriteUnraisable("View.MemoryView.memoryview_check", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
13959  __pyx_r = 0;
13960  __pyx_L0:;
13961  __Pyx_TraceReturn(Py_None, 0);
13962  __Pyx_RefNannyFinishContext();
13963  return __pyx_r;
13964 }
13965 
13966 /* "View.MemoryView":666
13967  * return isinstance(o, memoryview)
13968  *
13969  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
13970  * """
13971  * Replace all ellipses with full slices and fill incomplete indices with
13972  */
13973 
13974 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
13975  PyObject *__pyx_v_tup = NULL;
13976  PyObject *__pyx_v_result = NULL;
13977  int __pyx_v_have_slices;
13978  int __pyx_v_seen_ellipsis;
13979  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
13980  PyObject *__pyx_v_item = NULL;
13981  Py_ssize_t __pyx_v_nslices;
13982  PyObject *__pyx_r = NULL;
13983  __Pyx_TraceDeclarations
13984  __Pyx_RefNannyDeclarations
13985  int __pyx_t_1;
13986  int __pyx_t_2;
13987  PyObject *__pyx_t_3 = NULL;
13988  PyObject *__pyx_t_4 = NULL;
13989  Py_ssize_t __pyx_t_5;
13990  PyObject *(*__pyx_t_6)(PyObject *);
13991  PyObject *__pyx_t_7 = NULL;
13992  Py_ssize_t __pyx_t_8;
13993  int __pyx_t_9;
13994  int __pyx_t_10;
13995  PyObject *__pyx_t_11 = NULL;
13996  int __pyx_lineno = 0;
13997  const char *__pyx_filename = NULL;
13998  int __pyx_clineno = 0;
13999  __Pyx_RefNannySetupContext("_unellipsify", 0);
14000  __Pyx_TraceCall("_unellipsify", __pyx_f[1], 666, 0, __PYX_ERR(1, 666, __pyx_L1_error));
14001 
14002  /* "View.MemoryView":671
14003  * full slices.
14004  * """
14005  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14006  * tup = (index,)
14007  * else:
14008  */
14009  __Pyx_TraceLine(671,0,__PYX_ERR(1, 671, __pyx_L1_error))
14010  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14011  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14012  if (__pyx_t_2) {
14013 
14014  /* "View.MemoryView":672
14015  * """
14016  * if not isinstance(index, tuple):
14017  * tup = (index,) # <<<<<<<<<<<<<<
14018  * else:
14019  * tup = index
14020  */
14021  __Pyx_TraceLine(672,0,__PYX_ERR(1, 672, __pyx_L1_error))
14022  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 672, __pyx_L1_error)
14023  __Pyx_GOTREF(__pyx_t_3);
14024  __Pyx_INCREF(__pyx_v_index);
14025  __Pyx_GIVEREF(__pyx_v_index);
14026  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14027  __pyx_v_tup = __pyx_t_3;
14028  __pyx_t_3 = 0;
14029 
14030  /* "View.MemoryView":671
14031  * full slices.
14032  * """
14033  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14034  * tup = (index,)
14035  * else:
14036  */
14037  goto __pyx_L3;
14038  }
14039 
14040  /* "View.MemoryView":674
14041  * tup = (index,)
14042  * else:
14043  * tup = index # <<<<<<<<<<<<<<
14044  *
14045  * result = []
14046  */
14047  __Pyx_TraceLine(674,0,__PYX_ERR(1, 674, __pyx_L1_error))
14048  /*else*/ {
14049  __Pyx_INCREF(__pyx_v_index);
14050  __pyx_v_tup = __pyx_v_index;
14051  }
14052  __pyx_L3:;
14053 
14054  /* "View.MemoryView":676
14055  * tup = index
14056  *
14057  * result = [] # <<<<<<<<<<<<<<
14058  * have_slices = False
14059  * seen_ellipsis = False
14060  */
14061  __Pyx_TraceLine(676,0,__PYX_ERR(1, 676, __pyx_L1_error))
14062  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 676, __pyx_L1_error)
14063  __Pyx_GOTREF(__pyx_t_3);
14064  __pyx_v_result = ((PyObject*)__pyx_t_3);
14065  __pyx_t_3 = 0;
14066 
14067  /* "View.MemoryView":677
14068  *
14069  * result = []
14070  * have_slices = False # <<<<<<<<<<<<<<
14071  * seen_ellipsis = False
14072  * for idx, item in enumerate(tup):
14073  */
14074  __Pyx_TraceLine(677,0,__PYX_ERR(1, 677, __pyx_L1_error))
14075  __pyx_v_have_slices = 0;
14076 
14077  /* "View.MemoryView":678
14078  * result = []
14079  * have_slices = False
14080  * seen_ellipsis = False # <<<<<<<<<<<<<<
14081  * for idx, item in enumerate(tup):
14082  * if item is Ellipsis:
14083  */
14084  __Pyx_TraceLine(678,0,__PYX_ERR(1, 678, __pyx_L1_error))
14085  __pyx_v_seen_ellipsis = 0;
14086 
14087  /* "View.MemoryView":679
14088  * have_slices = False
14089  * seen_ellipsis = False
14090  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14091  * if item is Ellipsis:
14092  * if not seen_ellipsis:
14093  */
14094  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14095  __Pyx_INCREF(__pyx_int_0);
14096  __pyx_t_3 = __pyx_int_0;
14097  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14098  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14099  __pyx_t_6 = NULL;
14100  } else {
14101  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 679, __pyx_L1_error)
14102  __Pyx_GOTREF(__pyx_t_4);
14103  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 679, __pyx_L1_error)
14104  }
14105  for (;;) {
14106  if (likely(!__pyx_t_6)) {
14107  if (likely(PyList_CheckExact(__pyx_t_4))) {
14108  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14109  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14110  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14111  #else
14112  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14113  __Pyx_GOTREF(__pyx_t_7);
14114  #endif
14115  } else {
14116  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14117  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14118  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(1, 679, __pyx_L1_error)
14119  #else
14120  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14121  __Pyx_GOTREF(__pyx_t_7);
14122  #endif
14123  }
14124  } else {
14125  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14126  if (unlikely(!__pyx_t_7)) {
14127  PyObject* exc_type = PyErr_Occurred();
14128  if (exc_type) {
14129  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14130  else __PYX_ERR(1, 679, __pyx_L1_error)
14131  }
14132  break;
14133  }
14134  __Pyx_GOTREF(__pyx_t_7);
14135  }
14136  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14137  __pyx_t_7 = 0;
14138  __Pyx_INCREF(__pyx_t_3);
14139  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14140  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 679, __pyx_L1_error)
14141  __Pyx_GOTREF(__pyx_t_7);
14142  __Pyx_DECREF(__pyx_t_3);
14143  __pyx_t_3 = __pyx_t_7;
14144  __pyx_t_7 = 0;
14145 
14146  /* "View.MemoryView":680
14147  * seen_ellipsis = False
14148  * for idx, item in enumerate(tup):
14149  * if item is Ellipsis: # <<<<<<<<<<<<<<
14150  * if not seen_ellipsis:
14151  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14152  */
14153  __Pyx_TraceLine(680,0,__PYX_ERR(1, 680, __pyx_L1_error))
14154  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14155  __pyx_t_1 = (__pyx_t_2 != 0);
14156  if (__pyx_t_1) {
14157 
14158  /* "View.MemoryView":681
14159  * for idx, item in enumerate(tup):
14160  * if item is Ellipsis:
14161  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14162  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14163  * seen_ellipsis = True
14164  */
14165  __Pyx_TraceLine(681,0,__PYX_ERR(1, 681, __pyx_L1_error))
14166  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14167  if (__pyx_t_1) {
14168 
14169  /* "View.MemoryView":682
14170  * if item is Ellipsis:
14171  * if not seen_ellipsis:
14172  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14173  * seen_ellipsis = True
14174  * else:
14175  */
14176  __Pyx_TraceLine(682,0,__PYX_ERR(1, 682, __pyx_L1_error))
14177  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14178  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 682, __pyx_L1_error)
14179  __Pyx_GOTREF(__pyx_t_7);
14180  { Py_ssize_t __pyx_temp;
14181  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14182  __Pyx_INCREF(__pyx_slice__32);
14183  __Pyx_GIVEREF(__pyx_slice__32);
14184  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__32);
14185  }
14186  }
14187  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 682, __pyx_L1_error)
14188  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14189 
14190  /* "View.MemoryView":683
14191  * if not seen_ellipsis:
14192  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14193  * seen_ellipsis = True # <<<<<<<<<<<<<<
14194  * else:
14195  * result.append(slice(None))
14196  */
14197  __Pyx_TraceLine(683,0,__PYX_ERR(1, 683, __pyx_L1_error))
14198  __pyx_v_seen_ellipsis = 1;
14199 
14200  /* "View.MemoryView":681
14201  * for idx, item in enumerate(tup):
14202  * if item is Ellipsis:
14203  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14204  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14205  * seen_ellipsis = True
14206  */
14207  goto __pyx_L7;
14208  }
14209 
14210  /* "View.MemoryView":685
14211  * seen_ellipsis = True
14212  * else:
14213  * result.append(slice(None)) # <<<<<<<<<<<<<<
14214  * have_slices = True
14215  * else:
14216  */
14217  __Pyx_TraceLine(685,0,__PYX_ERR(1, 685, __pyx_L1_error))
14218  /*else*/ {
14219  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 685, __pyx_L1_error)
14220  }
14221  __pyx_L7:;
14222 
14223  /* "View.MemoryView":686
14224  * else:
14225  * result.append(slice(None))
14226  * have_slices = True # <<<<<<<<<<<<<<
14227  * else:
14228  * if not isinstance(item, slice) and not PyIndex_Check(item):
14229  */
14230  __Pyx_TraceLine(686,0,__PYX_ERR(1, 686, __pyx_L1_error))
14231  __pyx_v_have_slices = 1;
14232 
14233  /* "View.MemoryView":680
14234  * seen_ellipsis = False
14235  * for idx, item in enumerate(tup):
14236  * if item is Ellipsis: # <<<<<<<<<<<<<<
14237  * if not seen_ellipsis:
14238  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14239  */
14240  goto __pyx_L6;
14241  }
14242 
14243  /* "View.MemoryView":688
14244  * have_slices = True
14245  * else:
14246  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14247  * raise TypeError("Cannot index with type '%s'" % type(item))
14248  *
14249  */
14250  __Pyx_TraceLine(688,0,__PYX_ERR(1, 688, __pyx_L1_error))
14251  /*else*/ {
14252  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14253  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14254  if (__pyx_t_10) {
14255  } else {
14256  __pyx_t_1 = __pyx_t_10;
14257  goto __pyx_L9_bool_binop_done;
14258  }
14259  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14260  __pyx_t_1 = __pyx_t_10;
14261  __pyx_L9_bool_binop_done:;
14262  if (unlikely(__pyx_t_1)) {
14263 
14264  /* "View.MemoryView":689
14265  * else:
14266  * if not isinstance(item, slice) and not PyIndex_Check(item):
14267  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14268  *
14269  * have_slices = have_slices or isinstance(item, slice)
14270  */
14271  __Pyx_TraceLine(689,0,__PYX_ERR(1, 689, __pyx_L1_error))
14272  __pyx_t_7 = __Pyx_PyString_FormatSafe(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 689, __pyx_L1_error)
14273  __Pyx_GOTREF(__pyx_t_7);
14274  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 689, __pyx_L1_error)
14275  __Pyx_GOTREF(__pyx_t_11);
14276  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14277  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14278  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14279  __PYX_ERR(1, 689, __pyx_L1_error)
14280 
14281  /* "View.MemoryView":688
14282  * have_slices = True
14283  * else:
14284  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14285  * raise TypeError("Cannot index with type '%s'" % type(item))
14286  *
14287  */
14288  }
14289 
14290  /* "View.MemoryView":691
14291  * raise TypeError("Cannot index with type '%s'" % type(item))
14292  *
14293  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14294  * result.append(item)
14295  *
14296  */
14297  __Pyx_TraceLine(691,0,__PYX_ERR(1, 691, __pyx_L1_error))
14298  __pyx_t_10 = (__pyx_v_have_slices != 0);
14299  if (!__pyx_t_10) {
14300  } else {
14301  __pyx_t_1 = __pyx_t_10;
14302  goto __pyx_L11_bool_binop_done;
14303  }
14304  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14305  __pyx_t_2 = (__pyx_t_10 != 0);
14306  __pyx_t_1 = __pyx_t_2;
14307  __pyx_L11_bool_binop_done:;
14308  __pyx_v_have_slices = __pyx_t_1;
14309 
14310  /* "View.MemoryView":692
14311  *
14312  * have_slices = have_slices or isinstance(item, slice)
14313  * result.append(item) # <<<<<<<<<<<<<<
14314  *
14315  * nslices = ndim - len(result)
14316  */
14317  __Pyx_TraceLine(692,0,__PYX_ERR(1, 692, __pyx_L1_error))
14318  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 692, __pyx_L1_error)
14319  }
14320  __pyx_L6:;
14321 
14322  /* "View.MemoryView":679
14323  * have_slices = False
14324  * seen_ellipsis = False
14325  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14326  * if item is Ellipsis:
14327  * if not seen_ellipsis:
14328  */
14329  __Pyx_TraceLine(679,0,__PYX_ERR(1, 679, __pyx_L1_error))
14330  }
14331  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14332  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14333 
14334  /* "View.MemoryView":694
14335  * result.append(item)
14336  *
14337  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14338  * if nslices:
14339  * result.extend([slice(None)] * nslices)
14340  */
14341  __Pyx_TraceLine(694,0,__PYX_ERR(1, 694, __pyx_L1_error))
14342  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(1, 694, __pyx_L1_error)
14343  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14344 
14345  /* "View.MemoryView":695
14346  *
14347  * nslices = ndim - len(result)
14348  * if nslices: # <<<<<<<<<<<<<<
14349  * result.extend([slice(None)] * nslices)
14350  *
14351  */
14352  __Pyx_TraceLine(695,0,__PYX_ERR(1, 695, __pyx_L1_error))
14353  __pyx_t_1 = (__pyx_v_nslices != 0);
14354  if (__pyx_t_1) {
14355 
14356  /* "View.MemoryView":696
14357  * nslices = ndim - len(result)
14358  * if nslices:
14359  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14360  *
14361  * return have_slices or nslices, tuple(result)
14362  */
14363  __Pyx_TraceLine(696,0,__PYX_ERR(1, 696, __pyx_L1_error))
14364  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 696, __pyx_L1_error)
14365  __Pyx_GOTREF(__pyx_t_3);
14366  { Py_ssize_t __pyx_temp;
14367  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14368  __Pyx_INCREF(__pyx_slice__32);
14369  __Pyx_GIVEREF(__pyx_slice__32);
14370  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__32);
14371  }
14372  }
14373  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 696, __pyx_L1_error)
14374  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14375 
14376  /* "View.MemoryView":695
14377  *
14378  * nslices = ndim - len(result)
14379  * if nslices: # <<<<<<<<<<<<<<
14380  * result.extend([slice(None)] * nslices)
14381  *
14382  */
14383  }
14384 
14385  /* "View.MemoryView":698
14386  * result.extend([slice(None)] * nslices)
14387  *
14388  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14389  *
14390  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14391  */
14392  __Pyx_TraceLine(698,0,__PYX_ERR(1, 698, __pyx_L1_error))
14393  __Pyx_XDECREF(__pyx_r);
14394  if (!__pyx_v_have_slices) {
14395  } else {
14396  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14397  __Pyx_GOTREF(__pyx_t_4);
14398  __pyx_t_3 = __pyx_t_4;
14399  __pyx_t_4 = 0;
14400  goto __pyx_L14_bool_binop_done;
14401  }
14402  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14403  __Pyx_GOTREF(__pyx_t_4);
14404  __pyx_t_3 = __pyx_t_4;
14405  __pyx_t_4 = 0;
14406  __pyx_L14_bool_binop_done:;
14407  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 698, __pyx_L1_error)
14408  __Pyx_GOTREF(__pyx_t_4);
14409  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(1, 698, __pyx_L1_error)
14410  __Pyx_GOTREF(__pyx_t_11);
14411  __Pyx_GIVEREF(__pyx_t_3);
14412  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14413  __Pyx_GIVEREF(__pyx_t_4);
14414  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14415  __pyx_t_3 = 0;
14416  __pyx_t_4 = 0;
14417  __pyx_r = ((PyObject*)__pyx_t_11);
14418  __pyx_t_11 = 0;
14419  goto __pyx_L0;
14420 
14421  /* "View.MemoryView":666
14422  * return isinstance(o, memoryview)
14423  *
14424  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14425  * """
14426  * Replace all ellipses with full slices and fill incomplete indices with
14427  */
14428 
14429  /* function exit code */
14430  __pyx_L1_error:;
14431  __Pyx_XDECREF(__pyx_t_3);
14432  __Pyx_XDECREF(__pyx_t_4);
14433  __Pyx_XDECREF(__pyx_t_7);
14434  __Pyx_XDECREF(__pyx_t_11);
14435  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14436  __pyx_r = 0;
14437  __pyx_L0:;
14438  __Pyx_XDECREF(__pyx_v_tup);
14439  __Pyx_XDECREF(__pyx_v_result);
14440  __Pyx_XDECREF(__pyx_v_idx);
14441  __Pyx_XDECREF(__pyx_v_item);
14442  __Pyx_XGIVEREF(__pyx_r);
14443  __Pyx_TraceReturn(__pyx_r, 0);
14444  __Pyx_RefNannyFinishContext();
14445  return __pyx_r;
14446 }
14447 
14448 /* "View.MemoryView":700
14449  * return have_slices or nslices, tuple(result)
14450  *
14451  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14452  * for suboffset in suboffsets[:ndim]:
14453  * if suboffset >= 0:
14454  */
14455 
14456 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14457  Py_ssize_t __pyx_v_suboffset;
14458  PyObject *__pyx_r = NULL;
14459  __Pyx_TraceDeclarations
14460  __Pyx_RefNannyDeclarations
14461  Py_ssize_t *__pyx_t_1;
14462  Py_ssize_t *__pyx_t_2;
14463  Py_ssize_t *__pyx_t_3;
14464  int __pyx_t_4;
14465  PyObject *__pyx_t_5 = NULL;
14466  int __pyx_lineno = 0;
14467  const char *__pyx_filename = NULL;
14468  int __pyx_clineno = 0;
14469  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14470  __Pyx_TraceCall("assert_direct_dimensions", __pyx_f[1], 700, 0, __PYX_ERR(1, 700, __pyx_L1_error));
14471 
14472  /* "View.MemoryView":701
14473  *
14474  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14475  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14476  * if suboffset >= 0:
14477  * raise ValueError("Indirect dimensions not supported")
14478  */
14479  __Pyx_TraceLine(701,0,__PYX_ERR(1, 701, __pyx_L1_error))
14480  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14481  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14482  __pyx_t_1 = __pyx_t_3;
14483  __pyx_v_suboffset = (__pyx_t_1[0]);
14484 
14485  /* "View.MemoryView":702
14486  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14487  * for suboffset in suboffsets[:ndim]:
14488  * if suboffset >= 0: # <<<<<<<<<<<<<<
14489  * raise ValueError("Indirect dimensions not supported")
14490  *
14491  */
14492  __Pyx_TraceLine(702,0,__PYX_ERR(1, 702, __pyx_L1_error))
14493  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14494  if (unlikely(__pyx_t_4)) {
14495 
14496  /* "View.MemoryView":703
14497  * for suboffset in suboffsets[:ndim]:
14498  * if suboffset >= 0:
14499  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14500  *
14501  *
14502  */
14503  __Pyx_TraceLine(703,0,__PYX_ERR(1, 703, __pyx_L1_error))
14504  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 703, __pyx_L1_error)
14505  __Pyx_GOTREF(__pyx_t_5);
14506  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14507  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14508  __PYX_ERR(1, 703, __pyx_L1_error)
14509 
14510  /* "View.MemoryView":702
14511  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14512  * for suboffset in suboffsets[:ndim]:
14513  * if suboffset >= 0: # <<<<<<<<<<<<<<
14514  * raise ValueError("Indirect dimensions not supported")
14515  *
14516  */
14517  }
14518  }
14519 
14520  /* "View.MemoryView":700
14521  * return have_slices or nslices, tuple(result)
14522  *
14523  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14524  * for suboffset in suboffsets[:ndim]:
14525  * if suboffset >= 0:
14526  */
14527 
14528  /* function exit code */
14529  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14530  goto __pyx_L0;
14531  __pyx_L1_error:;
14532  __Pyx_XDECREF(__pyx_t_5);
14533  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14534  __pyx_r = 0;
14535  __pyx_L0:;
14536  __Pyx_XGIVEREF(__pyx_r);
14537  __Pyx_TraceReturn(__pyx_r, 0);
14538  __Pyx_RefNannyFinishContext();
14539  return __pyx_r;
14540 }
14541 
14542 /* "View.MemoryView":710
14543  *
14544  * @cname('__pyx_memview_slice')
14545  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14546  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14547  * cdef bint negative_step
14548  */
14549 
14550 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14551  int __pyx_v_new_ndim;
14552  int __pyx_v_suboffset_dim;
14553  int __pyx_v_dim;
14554  __Pyx_memviewslice __pyx_v_src;
14555  __Pyx_memviewslice __pyx_v_dst;
14556  __Pyx_memviewslice *__pyx_v_p_src;
14557  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14558  __Pyx_memviewslice *__pyx_v_p_dst;
14559  int *__pyx_v_p_suboffset_dim;
14560  Py_ssize_t __pyx_v_start;
14561  Py_ssize_t __pyx_v_stop;
14562  Py_ssize_t __pyx_v_step;
14563  int __pyx_v_have_start;
14564  int __pyx_v_have_stop;
14565  int __pyx_v_have_step;
14566  PyObject *__pyx_v_index = NULL;
14567  struct __pyx_memoryview_obj *__pyx_r = NULL;
14568  __Pyx_TraceDeclarations
14569  __Pyx_RefNannyDeclarations
14570  int __pyx_t_1;
14571  int __pyx_t_2;
14572  PyObject *__pyx_t_3 = NULL;
14573  struct __pyx_memoryview_obj *__pyx_t_4;
14574  char *__pyx_t_5;
14575  int __pyx_t_6;
14576  Py_ssize_t __pyx_t_7;
14577  PyObject *(*__pyx_t_8)(PyObject *);
14578  PyObject *__pyx_t_9 = NULL;
14579  Py_ssize_t __pyx_t_10;
14580  int __pyx_t_11;
14581  Py_ssize_t __pyx_t_12;
14582  int __pyx_lineno = 0;
14583  const char *__pyx_filename = NULL;
14584  int __pyx_clineno = 0;
14585  __Pyx_RefNannySetupContext("memview_slice", 0);
14586  __Pyx_TraceCall("memview_slice", __pyx_f[1], 710, 0, __PYX_ERR(1, 710, __pyx_L1_error));
14587 
14588  /* "View.MemoryView":711
14589  * @cname('__pyx_memview_slice')
14590  * cdef memoryview memview_slice(memoryview memview, object indices):
14591  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14592  * cdef bint negative_step
14593  * cdef __Pyx_memviewslice src, dst
14594  */
14595  __Pyx_TraceLine(711,0,__PYX_ERR(1, 711, __pyx_L1_error))
14596  __pyx_v_new_ndim = 0;
14597  __pyx_v_suboffset_dim = -1;
14598 
14599  /* "View.MemoryView":718
14600  *
14601  *
14602  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14603  *
14604  * cdef _memoryviewslice memviewsliceobj
14605  */
14606  __Pyx_TraceLine(718,0,__PYX_ERR(1, 718, __pyx_L1_error))
14607  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14608 
14609  /* "View.MemoryView":722
14610  * cdef _memoryviewslice memviewsliceobj
14611  *
14612  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14613  *
14614  * if isinstance(memview, _memoryviewslice):
14615  */
14616  __Pyx_TraceLine(722,0,__PYX_ERR(1, 722, __pyx_L1_error))
14617  #ifndef CYTHON_WITHOUT_ASSERTIONS
14618  if (unlikely(!Py_OptimizeFlag)) {
14619  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14620  PyErr_SetNone(PyExc_AssertionError);
14621  __PYX_ERR(1, 722, __pyx_L1_error)
14622  }
14623  }
14624  #endif
14625 
14626  /* "View.MemoryView":724
14627  * assert memview.view.ndim > 0
14628  *
14629  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14630  * memviewsliceobj = memview
14631  * p_src = &memviewsliceobj.from_slice
14632  */
14633  __Pyx_TraceLine(724,0,__PYX_ERR(1, 724, __pyx_L1_error))
14634  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14635  __pyx_t_2 = (__pyx_t_1 != 0);
14636  if (__pyx_t_2) {
14637 
14638  /* "View.MemoryView":725
14639  *
14640  * if isinstance(memview, _memoryviewslice):
14641  * memviewsliceobj = memview # <<<<<<<<<<<<<<
14642  * p_src = &memviewsliceobj.from_slice
14643  * else:
14644  */
14645  __Pyx_TraceLine(725,0,__PYX_ERR(1, 725, __pyx_L1_error))
14646  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 725, __pyx_L1_error)
14647  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
14648  __Pyx_INCREF(__pyx_t_3);
14649  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
14650  __pyx_t_3 = 0;
14651 
14652  /* "View.MemoryView":726
14653  * if isinstance(memview, _memoryviewslice):
14654  * memviewsliceobj = memview
14655  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
14656  * else:
14657  * slice_copy(memview, &src)
14658  */
14659  __Pyx_TraceLine(726,0,__PYX_ERR(1, 726, __pyx_L1_error))
14660  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
14661 
14662  /* "View.MemoryView":724
14663  * assert memview.view.ndim > 0
14664  *
14665  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14666  * memviewsliceobj = memview
14667  * p_src = &memviewsliceobj.from_slice
14668  */
14669  goto __pyx_L3;
14670  }
14671 
14672  /* "View.MemoryView":728
14673  * p_src = &memviewsliceobj.from_slice
14674  * else:
14675  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
14676  * p_src = &src
14677  *
14678  */
14679  __Pyx_TraceLine(728,0,__PYX_ERR(1, 728, __pyx_L1_error))
14680  /*else*/ {
14681  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
14682 
14683  /* "View.MemoryView":729
14684  * else:
14685  * slice_copy(memview, &src)
14686  * p_src = &src # <<<<<<<<<<<<<<
14687  *
14688  *
14689  */
14690  __Pyx_TraceLine(729,0,__PYX_ERR(1, 729, __pyx_L1_error))
14691  __pyx_v_p_src = (&__pyx_v_src);
14692  }
14693  __pyx_L3:;
14694 
14695  /* "View.MemoryView":735
14696  *
14697  *
14698  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
14699  * dst.data = p_src.data
14700  *
14701  */
14702  __Pyx_TraceLine(735,0,__PYX_ERR(1, 735, __pyx_L1_error))
14703  __pyx_t_4 = __pyx_v_p_src->memview;
14704  __pyx_v_dst.memview = __pyx_t_4;
14705 
14706  /* "View.MemoryView":736
14707  *
14708  * dst.memview = p_src.memview
14709  * dst.data = p_src.data # <<<<<<<<<<<<<<
14710  *
14711  *
14712  */
14713  __Pyx_TraceLine(736,0,__PYX_ERR(1, 736, __pyx_L1_error))
14714  __pyx_t_5 = __pyx_v_p_src->data;
14715  __pyx_v_dst.data = __pyx_t_5;
14716 
14717  /* "View.MemoryView":741
14718  *
14719  *
14720  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
14721  * cdef int *p_suboffset_dim = &suboffset_dim
14722  * cdef Py_ssize_t start, stop, step
14723  */
14724  __Pyx_TraceLine(741,0,__PYX_ERR(1, 741, __pyx_L1_error))
14725  __pyx_v_p_dst = (&__pyx_v_dst);
14726 
14727  /* "View.MemoryView":742
14728  *
14729  * cdef __Pyx_memviewslice *p_dst = &dst
14730  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
14731  * cdef Py_ssize_t start, stop, step
14732  * cdef bint have_start, have_stop, have_step
14733  */
14734  __Pyx_TraceLine(742,0,__PYX_ERR(1, 742, __pyx_L1_error))
14735  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
14736 
14737  /* "View.MemoryView":746
14738  * cdef bint have_start, have_stop, have_step
14739  *
14740  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
14741  * if PyIndex_Check(index):
14742  * slice_memviewslice(
14743  */
14744  __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
14745  __pyx_t_6 = 0;
14746  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
14747  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
14748  __pyx_t_8 = NULL;
14749  } else {
14750  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 746, __pyx_L1_error)
14751  __Pyx_GOTREF(__pyx_t_3);
14752  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 746, __pyx_L1_error)
14753  }
14754  for (;;) {
14755  if (likely(!__pyx_t_8)) {
14756  if (likely(PyList_CheckExact(__pyx_t_3))) {
14757  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
14758  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14759  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14760  #else
14761  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14762  __Pyx_GOTREF(__pyx_t_9);
14763  #endif
14764  } else {
14765  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
14766  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14767  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(1, 746, __pyx_L1_error)
14768  #else
14769  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 746, __pyx_L1_error)
14770  __Pyx_GOTREF(__pyx_t_9);
14771  #endif
14772  }
14773  } else {
14774  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
14775  if (unlikely(!__pyx_t_9)) {
14776  PyObject* exc_type = PyErr_Occurred();
14777  if (exc_type) {
14778  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14779  else __PYX_ERR(1, 746, __pyx_L1_error)
14780  }
14781  break;
14782  }
14783  __Pyx_GOTREF(__pyx_t_9);
14784  }
14785  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
14786  __pyx_t_9 = 0;
14787  __pyx_v_dim = __pyx_t_6;
14788  __pyx_t_6 = (__pyx_t_6 + 1);
14789 
14790  /* "View.MemoryView":747
14791  *
14792  * for dim, index in enumerate(indices):
14793  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14794  * slice_memviewslice(
14795  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14796  */
14797  __Pyx_TraceLine(747,0,__PYX_ERR(1, 747, __pyx_L1_error))
14798  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
14799  if (__pyx_t_2) {
14800 
14801  /* "View.MemoryView":751
14802  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14803  * dim, new_ndim, p_suboffset_dim,
14804  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
14805  * 0, 0, 0, # have_{start,stop,step}
14806  * False)
14807  */
14808  __Pyx_TraceLine(751,0,__PYX_ERR(1, 751, __pyx_L1_error))
14809  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 751, __pyx_L1_error)
14810 
14811  /* "View.MemoryView":748
14812  * for dim, index in enumerate(indices):
14813  * if PyIndex_Check(index):
14814  * slice_memviewslice( # <<<<<<<<<<<<<<
14815  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14816  * dim, new_ndim, p_suboffset_dim,
14817  */
14818  __Pyx_TraceLine(748,0,__PYX_ERR(1, 748, __pyx_L1_error))
14819  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 748, __pyx_L1_error)
14820 
14821  /* "View.MemoryView":747
14822  *
14823  * for dim, index in enumerate(indices):
14824  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
14825  * slice_memviewslice(
14826  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
14827  */
14828  goto __pyx_L6;
14829  }
14830 
14831  /* "View.MemoryView":754
14832  * 0, 0, 0, # have_{start,stop,step}
14833  * False)
14834  * elif index is None: # <<<<<<<<<<<<<<
14835  * p_dst.shape[new_ndim] = 1
14836  * p_dst.strides[new_ndim] = 0
14837  */
14838  __Pyx_TraceLine(754,0,__PYX_ERR(1, 754, __pyx_L1_error))
14839  __pyx_t_2 = (__pyx_v_index == Py_None);
14840  __pyx_t_1 = (__pyx_t_2 != 0);
14841  if (__pyx_t_1) {
14842 
14843  /* "View.MemoryView":755
14844  * False)
14845  * elif index is None:
14846  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
14847  * p_dst.strides[new_ndim] = 0
14848  * p_dst.suboffsets[new_ndim] = -1
14849  */
14850  __Pyx_TraceLine(755,0,__PYX_ERR(1, 755, __pyx_L1_error))
14851  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
14852 
14853  /* "View.MemoryView":756
14854  * elif index is None:
14855  * p_dst.shape[new_ndim] = 1
14856  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
14857  * p_dst.suboffsets[new_ndim] = -1
14858  * new_ndim += 1
14859  */
14860  __Pyx_TraceLine(756,0,__PYX_ERR(1, 756, __pyx_L1_error))
14861  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
14862 
14863  /* "View.MemoryView":757
14864  * p_dst.shape[new_ndim] = 1
14865  * p_dst.strides[new_ndim] = 0
14866  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
14867  * new_ndim += 1
14868  * else:
14869  */
14870  __Pyx_TraceLine(757,0,__PYX_ERR(1, 757, __pyx_L1_error))
14871  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
14872 
14873  /* "View.MemoryView":758
14874  * p_dst.strides[new_ndim] = 0
14875  * p_dst.suboffsets[new_ndim] = -1
14876  * new_ndim += 1 # <<<<<<<<<<<<<<
14877  * else:
14878  * start = index.start or 0
14879  */
14880  __Pyx_TraceLine(758,0,__PYX_ERR(1, 758, __pyx_L1_error))
14881  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
14882 
14883  /* "View.MemoryView":754
14884  * 0, 0, 0, # have_{start,stop,step}
14885  * False)
14886  * elif index is None: # <<<<<<<<<<<<<<
14887  * p_dst.shape[new_ndim] = 1
14888  * p_dst.strides[new_ndim] = 0
14889  */
14890  goto __pyx_L6;
14891  }
14892 
14893  /* "View.MemoryView":760
14894  * new_ndim += 1
14895  * else:
14896  * start = index.start or 0 # <<<<<<<<<<<<<<
14897  * stop = index.stop or 0
14898  * step = index.step or 0
14899  */
14900  __Pyx_TraceLine(760,0,__PYX_ERR(1, 760, __pyx_L1_error))
14901  /*else*/ {
14902  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 760, __pyx_L1_error)
14903  __Pyx_GOTREF(__pyx_t_9);
14904  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 760, __pyx_L1_error)
14905  if (!__pyx_t_1) {
14906  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14907  } else {
14908  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 760, __pyx_L1_error)
14909  __pyx_t_10 = __pyx_t_12;
14910  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14911  goto __pyx_L7_bool_binop_done;
14912  }
14913  __pyx_t_10 = 0;
14914  __pyx_L7_bool_binop_done:;
14915  __pyx_v_start = __pyx_t_10;
14916 
14917  /* "View.MemoryView":761
14918  * else:
14919  * start = index.start or 0
14920  * stop = index.stop or 0 # <<<<<<<<<<<<<<
14921  * step = index.step or 0
14922  *
14923  */
14924  __Pyx_TraceLine(761,0,__PYX_ERR(1, 761, __pyx_L1_error))
14925  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 761, __pyx_L1_error)
14926  __Pyx_GOTREF(__pyx_t_9);
14927  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 761, __pyx_L1_error)
14928  if (!__pyx_t_1) {
14929  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14930  } else {
14931  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 761, __pyx_L1_error)
14932  __pyx_t_10 = __pyx_t_12;
14933  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14934  goto __pyx_L9_bool_binop_done;
14935  }
14936  __pyx_t_10 = 0;
14937  __pyx_L9_bool_binop_done:;
14938  __pyx_v_stop = __pyx_t_10;
14939 
14940  /* "View.MemoryView":762
14941  * start = index.start or 0
14942  * stop = index.stop or 0
14943  * step = index.step or 0 # <<<<<<<<<<<<<<
14944  *
14945  * have_start = index.start is not None
14946  */
14947  __Pyx_TraceLine(762,0,__PYX_ERR(1, 762, __pyx_L1_error))
14948  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 762, __pyx_L1_error)
14949  __Pyx_GOTREF(__pyx_t_9);
14950  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 762, __pyx_L1_error)
14951  if (!__pyx_t_1) {
14952  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14953  } else {
14954  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 762, __pyx_L1_error)
14955  __pyx_t_10 = __pyx_t_12;
14956  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14957  goto __pyx_L11_bool_binop_done;
14958  }
14959  __pyx_t_10 = 0;
14960  __pyx_L11_bool_binop_done:;
14961  __pyx_v_step = __pyx_t_10;
14962 
14963  /* "View.MemoryView":764
14964  * step = index.step or 0
14965  *
14966  * have_start = index.start is not None # <<<<<<<<<<<<<<
14967  * have_stop = index.stop is not None
14968  * have_step = index.step is not None
14969  */
14970  __Pyx_TraceLine(764,0,__PYX_ERR(1, 764, __pyx_L1_error))
14971  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 764, __pyx_L1_error)
14972  __Pyx_GOTREF(__pyx_t_9);
14973  __pyx_t_1 = (__pyx_t_9 != Py_None);
14974  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14975  __pyx_v_have_start = __pyx_t_1;
14976 
14977  /* "View.MemoryView":765
14978  *
14979  * have_start = index.start is not None
14980  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
14981  * have_step = index.step is not None
14982  *
14983  */
14984  __Pyx_TraceLine(765,0,__PYX_ERR(1, 765, __pyx_L1_error))
14985  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 765, __pyx_L1_error)
14986  __Pyx_GOTREF(__pyx_t_9);
14987  __pyx_t_1 = (__pyx_t_9 != Py_None);
14988  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
14989  __pyx_v_have_stop = __pyx_t_1;
14990 
14991  /* "View.MemoryView":766
14992  * have_start = index.start is not None
14993  * have_stop = index.stop is not None
14994  * have_step = index.step is not None # <<<<<<<<<<<<<<
14995  *
14996  * slice_memviewslice(
14997  */
14998  __Pyx_TraceLine(766,0,__PYX_ERR(1, 766, __pyx_L1_error))
14999  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 766, __pyx_L1_error)
15000  __Pyx_GOTREF(__pyx_t_9);
15001  __pyx_t_1 = (__pyx_t_9 != Py_None);
15002  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15003  __pyx_v_have_step = __pyx_t_1;
15004 
15005  /* "View.MemoryView":768
15006  * have_step = index.step is not None
15007  *
15008  * slice_memviewslice( # <<<<<<<<<<<<<<
15009  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15010  * dim, new_ndim, p_suboffset_dim,
15011  */
15012  __Pyx_TraceLine(768,0,__PYX_ERR(1, 768, __pyx_L1_error))
15013  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(1, 768, __pyx_L1_error)
15014 
15015  /* "View.MemoryView":774
15016  * have_start, have_stop, have_step,
15017  * True)
15018  * new_ndim += 1 # <<<<<<<<<<<<<<
15019  *
15020  * if isinstance(memview, _memoryviewslice):
15021  */
15022  __Pyx_TraceLine(774,0,__PYX_ERR(1, 774, __pyx_L1_error))
15023  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15024  }
15025  __pyx_L6:;
15026 
15027  /* "View.MemoryView":746
15028  * cdef bint have_start, have_stop, have_step
15029  *
15030  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15031  * if PyIndex_Check(index):
15032  * slice_memviewslice(
15033  */
15034  __Pyx_TraceLine(746,0,__PYX_ERR(1, 746, __pyx_L1_error))
15035  }
15036  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15037 
15038  /* "View.MemoryView":776
15039  * new_ndim += 1
15040  *
15041  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15042  * return memoryview_fromslice(dst, new_ndim,
15043  * memviewsliceobj.to_object_func,
15044  */
15045  __Pyx_TraceLine(776,0,__PYX_ERR(1, 776, __pyx_L1_error))
15046  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15047  __pyx_t_2 = (__pyx_t_1 != 0);
15048  if (__pyx_t_2) {
15049 
15050  /* "View.MemoryView":777
15051  *
15052  * if isinstance(memview, _memoryviewslice):
15053  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15054  * memviewsliceobj.to_object_func,
15055  * memviewsliceobj.to_dtype_func,
15056  */
15057  __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
15058  __Pyx_XDECREF(((PyObject *)__pyx_r));
15059 
15060  /* "View.MemoryView":778
15061  * if isinstance(memview, _memoryviewslice):
15062  * return memoryview_fromslice(dst, new_ndim,
15063  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15064  * memviewsliceobj.to_dtype_func,
15065  * memview.dtype_is_object)
15066  */
15067  __Pyx_TraceLine(778,0,__PYX_ERR(1, 778, __pyx_L1_error))
15068  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 778, __pyx_L1_error) }
15069 
15070  /* "View.MemoryView":779
15071  * return memoryview_fromslice(dst, new_ndim,
15072  * memviewsliceobj.to_object_func,
15073  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15074  * memview.dtype_is_object)
15075  * else:
15076  */
15077  __Pyx_TraceLine(779,0,__PYX_ERR(1, 779, __pyx_L1_error))
15078  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(1, 779, __pyx_L1_error) }
15079 
15080  /* "View.MemoryView":777
15081  *
15082  * if isinstance(memview, _memoryviewslice):
15083  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15084  * memviewsliceobj.to_object_func,
15085  * memviewsliceobj.to_dtype_func,
15086  */
15087  __Pyx_TraceLine(777,0,__PYX_ERR(1, 777, __pyx_L1_error))
15088  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 777, __pyx_L1_error)
15089  __Pyx_GOTREF(__pyx_t_3);
15090  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 777, __pyx_L1_error)
15091  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15092  __pyx_t_3 = 0;
15093  goto __pyx_L0;
15094 
15095  /* "View.MemoryView":776
15096  * new_ndim += 1
15097  *
15098  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15099  * return memoryview_fromslice(dst, new_ndim,
15100  * memviewsliceobj.to_object_func,
15101  */
15102  }
15103 
15104  /* "View.MemoryView":782
15105  * memview.dtype_is_object)
15106  * else:
15107  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15108  * memview.dtype_is_object)
15109  *
15110  */
15111  __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
15112  /*else*/ {
15113  __Pyx_XDECREF(((PyObject *)__pyx_r));
15114 
15115  /* "View.MemoryView":783
15116  * else:
15117  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15118  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15119  *
15120  *
15121  */
15122  __Pyx_TraceLine(783,0,__PYX_ERR(1, 783, __pyx_L1_error))
15123  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 782, __pyx_L1_error)
15124  __Pyx_GOTREF(__pyx_t_3);
15125 
15126  /* "View.MemoryView":782
15127  * memview.dtype_is_object)
15128  * else:
15129  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15130  * memview.dtype_is_object)
15131  *
15132  */
15133  __Pyx_TraceLine(782,0,__PYX_ERR(1, 782, __pyx_L1_error))
15134  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(1, 782, __pyx_L1_error)
15135  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15136  __pyx_t_3 = 0;
15137  goto __pyx_L0;
15138  }
15139 
15140  /* "View.MemoryView":710
15141  *
15142  * @cname('__pyx_memview_slice')
15143  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15144  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15145  * cdef bint negative_step
15146  */
15147 
15148  /* function exit code */
15149  __pyx_L1_error:;
15150  __Pyx_XDECREF(__pyx_t_3);
15151  __Pyx_XDECREF(__pyx_t_9);
15152  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15153  __pyx_r = 0;
15154  __pyx_L0:;
15155  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15156  __Pyx_XDECREF(__pyx_v_index);
15157  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15158  __Pyx_TraceReturn(__pyx_r, 0);
15159  __Pyx_RefNannyFinishContext();
15160  return __pyx_r;
15161 }
15162 
15163 /* "View.MemoryView":807
15164  *
15165  * @cname('__pyx_memoryview_slice_memviewslice')
15166  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15167  * __Pyx_memviewslice *dst,
15168  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15169  */
15170 
15171 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15172  Py_ssize_t __pyx_v_new_shape;
15173  int __pyx_v_negative_step;
15174  int __pyx_r;
15175  __Pyx_TraceDeclarations
15176  int __pyx_t_1;
15177  int __pyx_t_2;
15178  int __pyx_t_3;
15179  int __pyx_lineno = 0;
15180  const char *__pyx_filename = NULL;
15181  int __pyx_clineno = 0;
15182  __Pyx_TraceCall("slice_memviewslice", __pyx_f[1], 807, 1, __PYX_ERR(1, 807, __pyx_L1_error));
15183 
15184  /* "View.MemoryView":827
15185  * cdef bint negative_step
15186  *
15187  * if not is_slice: # <<<<<<<<<<<<<<
15188  *
15189  * if start < 0:
15190  */
15191  __Pyx_TraceLine(827,1,__PYX_ERR(1, 827, __pyx_L1_error))
15192  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15193  if (__pyx_t_1) {
15194 
15195  /* "View.MemoryView":829
15196  * if not is_slice:
15197  *
15198  * if start < 0: # <<<<<<<<<<<<<<
15199  * start += shape
15200  * if not 0 <= start < shape:
15201  */
15202  __Pyx_TraceLine(829,1,__PYX_ERR(1, 829, __pyx_L1_error))
15203  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15204  if (__pyx_t_1) {
15205 
15206  /* "View.MemoryView":830
15207  *
15208  * if start < 0:
15209  * start += shape # <<<<<<<<<<<<<<
15210  * if not 0 <= start < shape:
15211  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15212  */
15213  __Pyx_TraceLine(830,1,__PYX_ERR(1, 830, __pyx_L1_error))
15214  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15215 
15216  /* "View.MemoryView":829
15217  * if not is_slice:
15218  *
15219  * if start < 0: # <<<<<<<<<<<<<<
15220  * start += shape
15221  * if not 0 <= start < shape:
15222  */
15223  }
15224 
15225  /* "View.MemoryView":831
15226  * if start < 0:
15227  * start += shape
15228  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15229  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15230  * else:
15231  */
15232  __Pyx_TraceLine(831,1,__PYX_ERR(1, 831, __pyx_L1_error))
15233  __pyx_t_1 = (0 <= __pyx_v_start);
15234  if (__pyx_t_1) {
15235  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15236  }
15237  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15238  if (__pyx_t_2) {
15239 
15240  /* "View.MemoryView":832
15241  * start += shape
15242  * if not 0 <= start < shape:
15243  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15244  * else:
15245  *
15246  */
15247  __Pyx_TraceLine(832,1,__PYX_ERR(1, 832, __pyx_L1_error))
15248  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 832, __pyx_L1_error)
15249 
15250  /* "View.MemoryView":831
15251  * if start < 0:
15252  * start += shape
15253  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15254  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15255  * else:
15256  */
15257  }
15258 
15259  /* "View.MemoryView":827
15260  * cdef bint negative_step
15261  *
15262  * if not is_slice: # <<<<<<<<<<<<<<
15263  *
15264  * if start < 0:
15265  */
15266  goto __pyx_L3;
15267  }
15268 
15269  /* "View.MemoryView":835
15270  * else:
15271  *
15272  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15273  *
15274  * if have_step and step == 0:
15275  */
15276  __Pyx_TraceLine(835,1,__PYX_ERR(1, 835, __pyx_L1_error))
15277  /*else*/ {
15278  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15279  if (__pyx_t_1) {
15280  } else {
15281  __pyx_t_2 = __pyx_t_1;
15282  goto __pyx_L6_bool_binop_done;
15283  }
15284  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15285  __pyx_t_2 = __pyx_t_1;
15286  __pyx_L6_bool_binop_done:;
15287  __pyx_v_negative_step = __pyx_t_2;
15288 
15289  /* "View.MemoryView":837
15290  * negative_step = have_step != 0 and step < 0
15291  *
15292  * if have_step and step == 0: # <<<<<<<<<<<<<<
15293  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15294  *
15295  */
15296  __Pyx_TraceLine(837,1,__PYX_ERR(1, 837, __pyx_L1_error))
15297  __pyx_t_1 = (__pyx_v_have_step != 0);
15298  if (__pyx_t_1) {
15299  } else {
15300  __pyx_t_2 = __pyx_t_1;
15301  goto __pyx_L9_bool_binop_done;
15302  }
15303  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15304  __pyx_t_2 = __pyx_t_1;
15305  __pyx_L9_bool_binop_done:;
15306  if (__pyx_t_2) {
15307 
15308  /* "View.MemoryView":838
15309  *
15310  * if have_step and step == 0:
15311  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15312  *
15313  *
15314  */
15315  __Pyx_TraceLine(838,1,__PYX_ERR(1, 838, __pyx_L1_error))
15316  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 838, __pyx_L1_error)
15317 
15318  /* "View.MemoryView":837
15319  * negative_step = have_step != 0 and step < 0
15320  *
15321  * if have_step and step == 0: # <<<<<<<<<<<<<<
15322  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15323  *
15324  */
15325  }
15326 
15327  /* "View.MemoryView":841
15328  *
15329  *
15330  * if have_start: # <<<<<<<<<<<<<<
15331  * if start < 0:
15332  * start += shape
15333  */
15334  __Pyx_TraceLine(841,1,__PYX_ERR(1, 841, __pyx_L1_error))
15335  __pyx_t_2 = (__pyx_v_have_start != 0);
15336  if (__pyx_t_2) {
15337 
15338  /* "View.MemoryView":842
15339  *
15340  * if have_start:
15341  * if start < 0: # <<<<<<<<<<<<<<
15342  * start += shape
15343  * if start < 0:
15344  */
15345  __Pyx_TraceLine(842,1,__PYX_ERR(1, 842, __pyx_L1_error))
15346  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15347  if (__pyx_t_2) {
15348 
15349  /* "View.MemoryView":843
15350  * if have_start:
15351  * if start < 0:
15352  * start += shape # <<<<<<<<<<<<<<
15353  * if start < 0:
15354  * start = 0
15355  */
15356  __Pyx_TraceLine(843,1,__PYX_ERR(1, 843, __pyx_L1_error))
15357  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15358 
15359  /* "View.MemoryView":844
15360  * if start < 0:
15361  * start += shape
15362  * if start < 0: # <<<<<<<<<<<<<<
15363  * start = 0
15364  * elif start >= shape:
15365  */
15366  __Pyx_TraceLine(844,1,__PYX_ERR(1, 844, __pyx_L1_error))
15367  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15368  if (__pyx_t_2) {
15369 
15370  /* "View.MemoryView":845
15371  * start += shape
15372  * if start < 0:
15373  * start = 0 # <<<<<<<<<<<<<<
15374  * elif start >= shape:
15375  * if negative_step:
15376  */
15377  __Pyx_TraceLine(845,1,__PYX_ERR(1, 845, __pyx_L1_error))
15378  __pyx_v_start = 0;
15379 
15380  /* "View.MemoryView":844
15381  * if start < 0:
15382  * start += shape
15383  * if start < 0: # <<<<<<<<<<<<<<
15384  * start = 0
15385  * elif start >= shape:
15386  */
15387  }
15388 
15389  /* "View.MemoryView":842
15390  *
15391  * if have_start:
15392  * if start < 0: # <<<<<<<<<<<<<<
15393  * start += shape
15394  * if start < 0:
15395  */
15396  goto __pyx_L12;
15397  }
15398 
15399  /* "View.MemoryView":846
15400  * if start < 0:
15401  * start = 0
15402  * elif start >= shape: # <<<<<<<<<<<<<<
15403  * if negative_step:
15404  * start = shape - 1
15405  */
15406  __Pyx_TraceLine(846,1,__PYX_ERR(1, 846, __pyx_L1_error))
15407  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15408  if (__pyx_t_2) {
15409 
15410  /* "View.MemoryView":847
15411  * start = 0
15412  * elif start >= shape:
15413  * if negative_step: # <<<<<<<<<<<<<<
15414  * start = shape - 1
15415  * else:
15416  */
15417  __Pyx_TraceLine(847,1,__PYX_ERR(1, 847, __pyx_L1_error))
15418  __pyx_t_2 = (__pyx_v_negative_step != 0);
15419  if (__pyx_t_2) {
15420 
15421  /* "View.MemoryView":848
15422  * elif start >= shape:
15423  * if negative_step:
15424  * start = shape - 1 # <<<<<<<<<<<<<<
15425  * else:
15426  * start = shape
15427  */
15428  __Pyx_TraceLine(848,1,__PYX_ERR(1, 848, __pyx_L1_error))
15429  __pyx_v_start = (__pyx_v_shape - 1);
15430 
15431  /* "View.MemoryView":847
15432  * start = 0
15433  * elif start >= shape:
15434  * if negative_step: # <<<<<<<<<<<<<<
15435  * start = shape - 1
15436  * else:
15437  */
15438  goto __pyx_L14;
15439  }
15440 
15441  /* "View.MemoryView":850
15442  * start = shape - 1
15443  * else:
15444  * start = shape # <<<<<<<<<<<<<<
15445  * else:
15446  * if negative_step:
15447  */
15448  __Pyx_TraceLine(850,1,__PYX_ERR(1, 850, __pyx_L1_error))
15449  /*else*/ {
15450  __pyx_v_start = __pyx_v_shape;
15451  }
15452  __pyx_L14:;
15453 
15454  /* "View.MemoryView":846
15455  * if start < 0:
15456  * start = 0
15457  * elif start >= shape: # <<<<<<<<<<<<<<
15458  * if negative_step:
15459  * start = shape - 1
15460  */
15461  }
15462  __pyx_L12:;
15463 
15464  /* "View.MemoryView":841
15465  *
15466  *
15467  * if have_start: # <<<<<<<<<<<<<<
15468  * if start < 0:
15469  * start += shape
15470  */
15471  goto __pyx_L11;
15472  }
15473 
15474  /* "View.MemoryView":852
15475  * start = shape
15476  * else:
15477  * if negative_step: # <<<<<<<<<<<<<<
15478  * start = shape - 1
15479  * else:
15480  */
15481  __Pyx_TraceLine(852,1,__PYX_ERR(1, 852, __pyx_L1_error))
15482  /*else*/ {
15483  __pyx_t_2 = (__pyx_v_negative_step != 0);
15484  if (__pyx_t_2) {
15485 
15486  /* "View.MemoryView":853
15487  * else:
15488  * if negative_step:
15489  * start = shape - 1 # <<<<<<<<<<<<<<
15490  * else:
15491  * start = 0
15492  */
15493  __Pyx_TraceLine(853,1,__PYX_ERR(1, 853, __pyx_L1_error))
15494  __pyx_v_start = (__pyx_v_shape - 1);
15495 
15496  /* "View.MemoryView":852
15497  * start = shape
15498  * else:
15499  * if negative_step: # <<<<<<<<<<<<<<
15500  * start = shape - 1
15501  * else:
15502  */
15503  goto __pyx_L15;
15504  }
15505 
15506  /* "View.MemoryView":855
15507  * start = shape - 1
15508  * else:
15509  * start = 0 # <<<<<<<<<<<<<<
15510  *
15511  * if have_stop:
15512  */
15513  __Pyx_TraceLine(855,1,__PYX_ERR(1, 855, __pyx_L1_error))
15514  /*else*/ {
15515  __pyx_v_start = 0;
15516  }
15517  __pyx_L15:;
15518  }
15519  __pyx_L11:;
15520 
15521  /* "View.MemoryView":857
15522  * start = 0
15523  *
15524  * if have_stop: # <<<<<<<<<<<<<<
15525  * if stop < 0:
15526  * stop += shape
15527  */
15528  __Pyx_TraceLine(857,1,__PYX_ERR(1, 857, __pyx_L1_error))
15529  __pyx_t_2 = (__pyx_v_have_stop != 0);
15530  if (__pyx_t_2) {
15531 
15532  /* "View.MemoryView":858
15533  *
15534  * if have_stop:
15535  * if stop < 0: # <<<<<<<<<<<<<<
15536  * stop += shape
15537  * if stop < 0:
15538  */
15539  __Pyx_TraceLine(858,1,__PYX_ERR(1, 858, __pyx_L1_error))
15540  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15541  if (__pyx_t_2) {
15542 
15543  /* "View.MemoryView":859
15544  * if have_stop:
15545  * if stop < 0:
15546  * stop += shape # <<<<<<<<<<<<<<
15547  * if stop < 0:
15548  * stop = 0
15549  */
15550  __Pyx_TraceLine(859,1,__PYX_ERR(1, 859, __pyx_L1_error))
15551  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15552 
15553  /* "View.MemoryView":860
15554  * if stop < 0:
15555  * stop += shape
15556  * if stop < 0: # <<<<<<<<<<<<<<
15557  * stop = 0
15558  * elif stop > shape:
15559  */
15560  __Pyx_TraceLine(860,1,__PYX_ERR(1, 860, __pyx_L1_error))
15561  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15562  if (__pyx_t_2) {
15563 
15564  /* "View.MemoryView":861
15565  * stop += shape
15566  * if stop < 0:
15567  * stop = 0 # <<<<<<<<<<<<<<
15568  * elif stop > shape:
15569  * stop = shape
15570  */
15571  __Pyx_TraceLine(861,1,__PYX_ERR(1, 861, __pyx_L1_error))
15572  __pyx_v_stop = 0;
15573 
15574  /* "View.MemoryView":860
15575  * if stop < 0:
15576  * stop += shape
15577  * if stop < 0: # <<<<<<<<<<<<<<
15578  * stop = 0
15579  * elif stop > shape:
15580  */
15581  }
15582 
15583  /* "View.MemoryView":858
15584  *
15585  * if have_stop:
15586  * if stop < 0: # <<<<<<<<<<<<<<
15587  * stop += shape
15588  * if stop < 0:
15589  */
15590  goto __pyx_L17;
15591  }
15592 
15593  /* "View.MemoryView":862
15594  * if stop < 0:
15595  * stop = 0
15596  * elif stop > shape: # <<<<<<<<<<<<<<
15597  * stop = shape
15598  * else:
15599  */
15600  __Pyx_TraceLine(862,1,__PYX_ERR(1, 862, __pyx_L1_error))
15601  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15602  if (__pyx_t_2) {
15603 
15604  /* "View.MemoryView":863
15605  * stop = 0
15606  * elif stop > shape:
15607  * stop = shape # <<<<<<<<<<<<<<
15608  * else:
15609  * if negative_step:
15610  */
15611  __Pyx_TraceLine(863,1,__PYX_ERR(1, 863, __pyx_L1_error))
15612  __pyx_v_stop = __pyx_v_shape;
15613 
15614  /* "View.MemoryView":862
15615  * if stop < 0:
15616  * stop = 0
15617  * elif stop > shape: # <<<<<<<<<<<<<<
15618  * stop = shape
15619  * else:
15620  */
15621  }
15622  __pyx_L17:;
15623 
15624  /* "View.MemoryView":857
15625  * start = 0
15626  *
15627  * if have_stop: # <<<<<<<<<<<<<<
15628  * if stop < 0:
15629  * stop += shape
15630  */
15631  goto __pyx_L16;
15632  }
15633 
15634  /* "View.MemoryView":865
15635  * stop = shape
15636  * else:
15637  * if negative_step: # <<<<<<<<<<<<<<
15638  * stop = -1
15639  * else:
15640  */
15641  __Pyx_TraceLine(865,1,__PYX_ERR(1, 865, __pyx_L1_error))
15642  /*else*/ {
15643  __pyx_t_2 = (__pyx_v_negative_step != 0);
15644  if (__pyx_t_2) {
15645 
15646  /* "View.MemoryView":866
15647  * else:
15648  * if negative_step:
15649  * stop = -1 # <<<<<<<<<<<<<<
15650  * else:
15651  * stop = shape
15652  */
15653  __Pyx_TraceLine(866,1,__PYX_ERR(1, 866, __pyx_L1_error))
15654  __pyx_v_stop = -1L;
15655 
15656  /* "View.MemoryView":865
15657  * stop = shape
15658  * else:
15659  * if negative_step: # <<<<<<<<<<<<<<
15660  * stop = -1
15661  * else:
15662  */
15663  goto __pyx_L19;
15664  }
15665 
15666  /* "View.MemoryView":868
15667  * stop = -1
15668  * else:
15669  * stop = shape # <<<<<<<<<<<<<<
15670  *
15671  * if not have_step:
15672  */
15673  __Pyx_TraceLine(868,1,__PYX_ERR(1, 868, __pyx_L1_error))
15674  /*else*/ {
15675  __pyx_v_stop = __pyx_v_shape;
15676  }
15677  __pyx_L19:;
15678  }
15679  __pyx_L16:;
15680 
15681  /* "View.MemoryView":870
15682  * stop = shape
15683  *
15684  * if not have_step: # <<<<<<<<<<<<<<
15685  * step = 1
15686  *
15687  */
15688  __Pyx_TraceLine(870,1,__PYX_ERR(1, 870, __pyx_L1_error))
15689  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15690  if (__pyx_t_2) {
15691 
15692  /* "View.MemoryView":871
15693  *
15694  * if not have_step:
15695  * step = 1 # <<<<<<<<<<<<<<
15696  *
15697  *
15698  */
15699  __Pyx_TraceLine(871,1,__PYX_ERR(1, 871, __pyx_L1_error))
15700  __pyx_v_step = 1;
15701 
15702  /* "View.MemoryView":870
15703  * stop = shape
15704  *
15705  * if not have_step: # <<<<<<<<<<<<<<
15706  * step = 1
15707  *
15708  */
15709  }
15710 
15711  /* "View.MemoryView":875
15712  *
15713  * with cython.cdivision(True):
15714  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
15715  *
15716  * if (stop - start) - step * new_shape:
15717  */
15718  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
15719 
15720  /* "View.MemoryView":877
15721  * new_shape = (stop - start) // step
15722  *
15723  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15724  * new_shape += 1
15725  *
15726  */
15727  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
15728  if (__pyx_t_2) {
15729 
15730  /* "View.MemoryView":878
15731  *
15732  * if (stop - start) - step * new_shape:
15733  * new_shape += 1 # <<<<<<<<<<<<<<
15734  *
15735  * if new_shape < 0:
15736  */
15737  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
15738 
15739  /* "View.MemoryView":877
15740  * new_shape = (stop - start) // step
15741  *
15742  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
15743  * new_shape += 1
15744  *
15745  */
15746  }
15747 
15748  /* "View.MemoryView":880
15749  * new_shape += 1
15750  *
15751  * if new_shape < 0: # <<<<<<<<<<<<<<
15752  * new_shape = 0
15753  *
15754  */
15755  __Pyx_TraceLine(880,1,__PYX_ERR(1, 880, __pyx_L1_error))
15756  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
15757  if (__pyx_t_2) {
15758 
15759  /* "View.MemoryView":881
15760  *
15761  * if new_shape < 0:
15762  * new_shape = 0 # <<<<<<<<<<<<<<
15763  *
15764  *
15765  */
15766  __Pyx_TraceLine(881,1,__PYX_ERR(1, 881, __pyx_L1_error))
15767  __pyx_v_new_shape = 0;
15768 
15769  /* "View.MemoryView":880
15770  * new_shape += 1
15771  *
15772  * if new_shape < 0: # <<<<<<<<<<<<<<
15773  * new_shape = 0
15774  *
15775  */
15776  }
15777 
15778  /* "View.MemoryView":884
15779  *
15780  *
15781  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
15782  * dst.shape[new_ndim] = new_shape
15783  * dst.suboffsets[new_ndim] = suboffset
15784  */
15785  __Pyx_TraceLine(884,1,__PYX_ERR(1, 884, __pyx_L1_error))
15786  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
15787 
15788  /* "View.MemoryView":885
15789  *
15790  * dst.strides[new_ndim] = stride * step
15791  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
15792  * dst.suboffsets[new_ndim] = suboffset
15793  *
15794  */
15795  __Pyx_TraceLine(885,1,__PYX_ERR(1, 885, __pyx_L1_error))
15796  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
15797 
15798  /* "View.MemoryView":886
15799  * dst.strides[new_ndim] = stride * step
15800  * dst.shape[new_ndim] = new_shape
15801  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
15802  *
15803  *
15804  */
15805  __Pyx_TraceLine(886,1,__PYX_ERR(1, 886, __pyx_L1_error))
15806  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
15807  }
15808  __pyx_L3:;
15809 
15810  /* "View.MemoryView":889
15811  *
15812  *
15813  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15814  * dst.data += start * stride
15815  * else:
15816  */
15817  __Pyx_TraceLine(889,1,__PYX_ERR(1, 889, __pyx_L1_error))
15818  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
15819  if (__pyx_t_2) {
15820 
15821  /* "View.MemoryView":890
15822  *
15823  * if suboffset_dim[0] < 0:
15824  * dst.data += start * stride # <<<<<<<<<<<<<<
15825  * else:
15826  * dst.suboffsets[suboffset_dim[0]] += start * stride
15827  */
15828  __Pyx_TraceLine(890,1,__PYX_ERR(1, 890, __pyx_L1_error))
15829  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
15830 
15831  /* "View.MemoryView":889
15832  *
15833  *
15834  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
15835  * dst.data += start * stride
15836  * else:
15837  */
15838  goto __pyx_L23;
15839  }
15840 
15841  /* "View.MemoryView":892
15842  * dst.data += start * stride
15843  * else:
15844  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
15845  *
15846  * if suboffset >= 0:
15847  */
15848  __Pyx_TraceLine(892,1,__PYX_ERR(1, 892, __pyx_L1_error))
15849  /*else*/ {
15850  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
15851  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
15852  }
15853  __pyx_L23:;
15854 
15855  /* "View.MemoryView":894
15856  * dst.suboffsets[suboffset_dim[0]] += start * stride
15857  *
15858  * if suboffset >= 0: # <<<<<<<<<<<<<<
15859  * if not is_slice:
15860  * if new_ndim == 0:
15861  */
15862  __Pyx_TraceLine(894,1,__PYX_ERR(1, 894, __pyx_L1_error))
15863  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
15864  if (__pyx_t_2) {
15865 
15866  /* "View.MemoryView":895
15867  *
15868  * if suboffset >= 0:
15869  * if not is_slice: # <<<<<<<<<<<<<<
15870  * if new_ndim == 0:
15871  * dst.data = (<char **> dst.data)[0] + suboffset
15872  */
15873  __Pyx_TraceLine(895,1,__PYX_ERR(1, 895, __pyx_L1_error))
15874  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
15875  if (__pyx_t_2) {
15876 
15877  /* "View.MemoryView":896
15878  * if suboffset >= 0:
15879  * if not is_slice:
15880  * if new_ndim == 0: # <<<<<<<<<<<<<<
15881  * dst.data = (<char **> dst.data)[0] + suboffset
15882  * else:
15883  */
15884  __Pyx_TraceLine(896,1,__PYX_ERR(1, 896, __pyx_L1_error))
15885  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
15886  if (__pyx_t_2) {
15887 
15888  /* "View.MemoryView":897
15889  * if not is_slice:
15890  * if new_ndim == 0:
15891  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
15892  * else:
15893  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15894  */
15895  __Pyx_TraceLine(897,1,__PYX_ERR(1, 897, __pyx_L1_error))
15896  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
15897 
15898  /* "View.MemoryView":896
15899  * if suboffset >= 0:
15900  * if not is_slice:
15901  * if new_ndim == 0: # <<<<<<<<<<<<<<
15902  * dst.data = (<char **> dst.data)[0] + suboffset
15903  * else:
15904  */
15905  goto __pyx_L26;
15906  }
15907 
15908  /* "View.MemoryView":899
15909  * dst.data = (<char **> dst.data)[0] + suboffset
15910  * else:
15911  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
15912  * "must be indexed and not sliced", dim)
15913  * else:
15914  */
15915  __Pyx_TraceLine(899,1,__PYX_ERR(1, 899, __pyx_L1_error))
15916  /*else*/ {
15917 
15918  /* "View.MemoryView":900
15919  * else:
15920  * _err_dim(IndexError, "All dimensions preceding dimension %d "
15921  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
15922  * else:
15923  * suboffset_dim[0] = new_ndim
15924  */
15925  __Pyx_TraceLine(900,1,__PYX_ERR(1, 900, __pyx_L1_error))
15926  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 899, __pyx_L1_error)
15927  }
15928  __pyx_L26:;
15929 
15930  /* "View.MemoryView":895
15931  *
15932  * if suboffset >= 0:
15933  * if not is_slice: # <<<<<<<<<<<<<<
15934  * if new_ndim == 0:
15935  * dst.data = (<char **> dst.data)[0] + suboffset
15936  */
15937  goto __pyx_L25;
15938  }
15939 
15940  /* "View.MemoryView":902
15941  * "must be indexed and not sliced", dim)
15942  * else:
15943  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
15944  *
15945  * return 0
15946  */
15947  __Pyx_TraceLine(902,1,__PYX_ERR(1, 902, __pyx_L1_error))
15948  /*else*/ {
15949  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
15950  }
15951  __pyx_L25:;
15952 
15953  /* "View.MemoryView":894
15954  * dst.suboffsets[suboffset_dim[0]] += start * stride
15955  *
15956  * if suboffset >= 0: # <<<<<<<<<<<<<<
15957  * if not is_slice:
15958  * if new_ndim == 0:
15959  */
15960  }
15961 
15962  /* "View.MemoryView":904
15963  * suboffset_dim[0] = new_ndim
15964  *
15965  * return 0 # <<<<<<<<<<<<<<
15966  *
15967  *
15968  */
15969  __Pyx_TraceLine(904,1,__PYX_ERR(1, 904, __pyx_L1_error))
15970  __pyx_r = 0;
15971  goto __pyx_L0;
15972 
15973  /* "View.MemoryView":807
15974  *
15975  * @cname('__pyx_memoryview_slice_memviewslice')
15976  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15977  * __Pyx_memviewslice *dst,
15978  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15979  */
15980 
15981  /* function exit code */
15982  __pyx_L1_error:;
15983  {
15984  #ifdef WITH_THREAD
15985  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
15986  #endif
15987  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15988  #ifdef WITH_THREAD
15989  __Pyx_PyGILState_Release(__pyx_gilstate_save);
15990  #endif
15991  }
15992  __pyx_r = -1;
15993  __pyx_L0:;
15994  __Pyx_TraceReturn(Py_None, 1);
15995  return __pyx_r;
15996 }
15997 
15998 /* "View.MemoryView":910
15999  *
16000  * @cname('__pyx_pybuffer_index')
16001  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16002  * Py_ssize_t dim) except NULL:
16003  * cdef Py_ssize_t shape, stride, suboffset = -1
16004  */
16005 
16006 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16007  Py_ssize_t __pyx_v_shape;
16008  Py_ssize_t __pyx_v_stride;
16009  Py_ssize_t __pyx_v_suboffset;
16010  Py_ssize_t __pyx_v_itemsize;
16011  char *__pyx_v_resultp;
16012  char *__pyx_r;
16013  __Pyx_TraceDeclarations
16014  __Pyx_RefNannyDeclarations
16015  Py_ssize_t __pyx_t_1;
16016  int __pyx_t_2;
16017  PyObject *__pyx_t_3 = NULL;
16018  PyObject *__pyx_t_4 = NULL;
16019  int __pyx_lineno = 0;
16020  const char *__pyx_filename = NULL;
16021  int __pyx_clineno = 0;
16022  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16023  __Pyx_TraceCall("pybuffer_index", __pyx_f[1], 910, 0, __PYX_ERR(1, 910, __pyx_L1_error));
16024 
16025  /* "View.MemoryView":912
16026  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16027  * Py_ssize_t dim) except NULL:
16028  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16029  * cdef Py_ssize_t itemsize = view.itemsize
16030  * cdef char *resultp
16031  */
16032  __Pyx_TraceLine(912,0,__PYX_ERR(1, 912, __pyx_L1_error))
16033  __pyx_v_suboffset = -1L;
16034 
16035  /* "View.MemoryView":913
16036  * Py_ssize_t dim) except NULL:
16037  * cdef Py_ssize_t shape, stride, suboffset = -1
16038  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16039  * cdef char *resultp
16040  *
16041  */
16042  __Pyx_TraceLine(913,0,__PYX_ERR(1, 913, __pyx_L1_error))
16043  __pyx_t_1 = __pyx_v_view->itemsize;
16044  __pyx_v_itemsize = __pyx_t_1;
16045 
16046  /* "View.MemoryView":916
16047  * cdef char *resultp
16048  *
16049  * if view.ndim == 0: # <<<<<<<<<<<<<<
16050  * shape = view.len / itemsize
16051  * stride = itemsize
16052  */
16053  __Pyx_TraceLine(916,0,__PYX_ERR(1, 916, __pyx_L1_error))
16054  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16055  if (__pyx_t_2) {
16056 
16057  /* "View.MemoryView":917
16058  *
16059  * if view.ndim == 0:
16060  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16061  * stride = itemsize
16062  * else:
16063  */
16064  __Pyx_TraceLine(917,0,__PYX_ERR(1, 917, __pyx_L1_error))
16065  if (unlikely(__pyx_v_itemsize == 0)) {
16066  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16067  __PYX_ERR(1, 917, __pyx_L1_error)
16068  }
16069  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16070  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16071  __PYX_ERR(1, 917, __pyx_L1_error)
16072  }
16073  __pyx_v_shape = (__pyx_v_view->len / __pyx_v_itemsize);
16074 
16075  /* "View.MemoryView":918
16076  * if view.ndim == 0:
16077  * shape = view.len / itemsize
16078  * stride = itemsize # <<<<<<<<<<<<<<
16079  * else:
16080  * shape = view.shape[dim]
16081  */
16082  __Pyx_TraceLine(918,0,__PYX_ERR(1, 918, __pyx_L1_error))
16083  __pyx_v_stride = __pyx_v_itemsize;
16084 
16085  /* "View.MemoryView":916
16086  * cdef char *resultp
16087  *
16088  * if view.ndim == 0: # <<<<<<<<<<<<<<
16089  * shape = view.len / itemsize
16090  * stride = itemsize
16091  */
16092  goto __pyx_L3;
16093  }
16094 
16095  /* "View.MemoryView":920
16096  * stride = itemsize
16097  * else:
16098  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16099  * stride = view.strides[dim]
16100  * if view.suboffsets != NULL:
16101  */
16102  __Pyx_TraceLine(920,0,__PYX_ERR(1, 920, __pyx_L1_error))
16103  /*else*/ {
16104  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16105 
16106  /* "View.MemoryView":921
16107  * else:
16108  * shape = view.shape[dim]
16109  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16110  * if view.suboffsets != NULL:
16111  * suboffset = view.suboffsets[dim]
16112  */
16113  __Pyx_TraceLine(921,0,__PYX_ERR(1, 921, __pyx_L1_error))
16114  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16115 
16116  /* "View.MemoryView":922
16117  * shape = view.shape[dim]
16118  * stride = view.strides[dim]
16119  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16120  * suboffset = view.suboffsets[dim]
16121  *
16122  */
16123  __Pyx_TraceLine(922,0,__PYX_ERR(1, 922, __pyx_L1_error))
16124  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16125  if (__pyx_t_2) {
16126 
16127  /* "View.MemoryView":923
16128  * stride = view.strides[dim]
16129  * if view.suboffsets != NULL:
16130  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16131  *
16132  * if index < 0:
16133  */
16134  __Pyx_TraceLine(923,0,__PYX_ERR(1, 923, __pyx_L1_error))
16135  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16136 
16137  /* "View.MemoryView":922
16138  * shape = view.shape[dim]
16139  * stride = view.strides[dim]
16140  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16141  * suboffset = view.suboffsets[dim]
16142  *
16143  */
16144  }
16145  }
16146  __pyx_L3:;
16147 
16148  /* "View.MemoryView":925
16149  * suboffset = view.suboffsets[dim]
16150  *
16151  * if index < 0: # <<<<<<<<<<<<<<
16152  * index += view.shape[dim]
16153  * if index < 0:
16154  */
16155  __Pyx_TraceLine(925,0,__PYX_ERR(1, 925, __pyx_L1_error))
16156  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16157  if (__pyx_t_2) {
16158 
16159  /* "View.MemoryView":926
16160  *
16161  * if index < 0:
16162  * index += view.shape[dim] # <<<<<<<<<<<<<<
16163  * if index < 0:
16164  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16165  */
16166  __Pyx_TraceLine(926,0,__PYX_ERR(1, 926, __pyx_L1_error))
16167  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16168 
16169  /* "View.MemoryView":927
16170  * if index < 0:
16171  * index += view.shape[dim]
16172  * if index < 0: # <<<<<<<<<<<<<<
16173  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16174  *
16175  */
16176  __Pyx_TraceLine(927,0,__PYX_ERR(1, 927, __pyx_L1_error))
16177  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16178  if (unlikely(__pyx_t_2)) {
16179 
16180  /* "View.MemoryView":928
16181  * index += view.shape[dim]
16182  * if index < 0:
16183  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16184  *
16185  * if index >= shape:
16186  */
16187  __Pyx_TraceLine(928,0,__PYX_ERR(1, 928, __pyx_L1_error))
16188  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16189  __Pyx_GOTREF(__pyx_t_3);
16190  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 928, __pyx_L1_error)
16191  __Pyx_GOTREF(__pyx_t_4);
16192  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16193  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 928, __pyx_L1_error)
16194  __Pyx_GOTREF(__pyx_t_3);
16195  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16196  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16197  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16198  __PYX_ERR(1, 928, __pyx_L1_error)
16199 
16200  /* "View.MemoryView":927
16201  * if index < 0:
16202  * index += view.shape[dim]
16203  * if index < 0: # <<<<<<<<<<<<<<
16204  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16205  *
16206  */
16207  }
16208 
16209  /* "View.MemoryView":925
16210  * suboffset = view.suboffsets[dim]
16211  *
16212  * if index < 0: # <<<<<<<<<<<<<<
16213  * index += view.shape[dim]
16214  * if index < 0:
16215  */
16216  }
16217 
16218  /* "View.MemoryView":930
16219  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16220  *
16221  * if index >= shape: # <<<<<<<<<<<<<<
16222  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16223  *
16224  */
16225  __Pyx_TraceLine(930,0,__PYX_ERR(1, 930, __pyx_L1_error))
16226  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16227  if (unlikely(__pyx_t_2)) {
16228 
16229  /* "View.MemoryView":931
16230  *
16231  * if index >= shape:
16232  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16233  *
16234  * resultp = bufp + index * stride
16235  */
16236  __Pyx_TraceLine(931,0,__PYX_ERR(1, 931, __pyx_L1_error))
16237  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16238  __Pyx_GOTREF(__pyx_t_3);
16239  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 931, __pyx_L1_error)
16240  __Pyx_GOTREF(__pyx_t_4);
16241  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16242  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 931, __pyx_L1_error)
16243  __Pyx_GOTREF(__pyx_t_3);
16244  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16245  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16246  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16247  __PYX_ERR(1, 931, __pyx_L1_error)
16248 
16249  /* "View.MemoryView":930
16250  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16251  *
16252  * if index >= shape: # <<<<<<<<<<<<<<
16253  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16254  *
16255  */
16256  }
16257 
16258  /* "View.MemoryView":933
16259  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16260  *
16261  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16262  * if suboffset >= 0:
16263  * resultp = (<char **> resultp)[0] + suboffset
16264  */
16265  __Pyx_TraceLine(933,0,__PYX_ERR(1, 933, __pyx_L1_error))
16266  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16267 
16268  /* "View.MemoryView":934
16269  *
16270  * resultp = bufp + index * stride
16271  * if suboffset >= 0: # <<<<<<<<<<<<<<
16272  * resultp = (<char **> resultp)[0] + suboffset
16273  *
16274  */
16275  __Pyx_TraceLine(934,0,__PYX_ERR(1, 934, __pyx_L1_error))
16276  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16277  if (__pyx_t_2) {
16278 
16279  /* "View.MemoryView":935
16280  * resultp = bufp + index * stride
16281  * if suboffset >= 0:
16282  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16283  *
16284  * return resultp
16285  */
16286  __Pyx_TraceLine(935,0,__PYX_ERR(1, 935, __pyx_L1_error))
16287  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16288 
16289  /* "View.MemoryView":934
16290  *
16291  * resultp = bufp + index * stride
16292  * if suboffset >= 0: # <<<<<<<<<<<<<<
16293  * resultp = (<char **> resultp)[0] + suboffset
16294  *
16295  */
16296  }
16297 
16298  /* "View.MemoryView":937
16299  * resultp = (<char **> resultp)[0] + suboffset
16300  *
16301  * return resultp # <<<<<<<<<<<<<<
16302  *
16303  *
16304  */
16305  __Pyx_TraceLine(937,0,__PYX_ERR(1, 937, __pyx_L1_error))
16306  __pyx_r = __pyx_v_resultp;
16307  goto __pyx_L0;
16308 
16309  /* "View.MemoryView":910
16310  *
16311  * @cname('__pyx_pybuffer_index')
16312  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16313  * Py_ssize_t dim) except NULL:
16314  * cdef Py_ssize_t shape, stride, suboffset = -1
16315  */
16316 
16317  /* function exit code */
16318  __pyx_L1_error:;
16319  __Pyx_XDECREF(__pyx_t_3);
16320  __Pyx_XDECREF(__pyx_t_4);
16321  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16322  __pyx_r = NULL;
16323  __pyx_L0:;
16324  __Pyx_TraceReturn(Py_None, 0);
16325  __Pyx_RefNannyFinishContext();
16326  return __pyx_r;
16327 }
16328 
16329 /* "View.MemoryView":943
16330  *
16331  * @cname('__pyx_memslice_transpose')
16332  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16333  * cdef int ndim = memslice.memview.view.ndim
16334  *
16335  */
16336 
16337 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16338  int __pyx_v_ndim;
16339  Py_ssize_t *__pyx_v_shape;
16340  Py_ssize_t *__pyx_v_strides;
16341  int __pyx_v_i;
16342  int __pyx_v_j;
16343  int __pyx_r;
16344  __Pyx_TraceDeclarations
16345  int __pyx_t_1;
16346  Py_ssize_t *__pyx_t_2;
16347  long __pyx_t_3;
16348  long __pyx_t_4;
16349  Py_ssize_t __pyx_t_5;
16350  Py_ssize_t __pyx_t_6;
16351  int __pyx_t_7;
16352  int __pyx_t_8;
16353  int __pyx_t_9;
16354  int __pyx_lineno = 0;
16355  const char *__pyx_filename = NULL;
16356  int __pyx_clineno = 0;
16357  __Pyx_TraceCall("transpose_memslice", __pyx_f[1], 943, 1, __PYX_ERR(1, 943, __pyx_L1_error));
16358 
16359  /* "View.MemoryView":944
16360  * @cname('__pyx_memslice_transpose')
16361  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16362  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16363  *
16364  * cdef Py_ssize_t *shape = memslice.shape
16365  */
16366  __Pyx_TraceLine(944,1,__PYX_ERR(1, 944, __pyx_L1_error))
16367  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16368  __pyx_v_ndim = __pyx_t_1;
16369 
16370  /* "View.MemoryView":946
16371  * cdef int ndim = memslice.memview.view.ndim
16372  *
16373  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16374  * cdef Py_ssize_t *strides = memslice.strides
16375  *
16376  */
16377  __Pyx_TraceLine(946,1,__PYX_ERR(1, 946, __pyx_L1_error))
16378  __pyx_t_2 = __pyx_v_memslice->shape;
16379  __pyx_v_shape = __pyx_t_2;
16380 
16381  /* "View.MemoryView":947
16382  *
16383  * cdef Py_ssize_t *shape = memslice.shape
16384  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16385  *
16386  *
16387  */
16388  __Pyx_TraceLine(947,1,__PYX_ERR(1, 947, __pyx_L1_error))
16389  __pyx_t_2 = __pyx_v_memslice->strides;
16390  __pyx_v_strides = __pyx_t_2;
16391 
16392  /* "View.MemoryView":951
16393  *
16394  * cdef int i, j
16395  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16396  * j = ndim - 1 - i
16397  * strides[i], strides[j] = strides[j], strides[i]
16398  */
16399  __Pyx_TraceLine(951,1,__PYX_ERR(1, 951, __pyx_L1_error))
16400  __pyx_t_3 = (__pyx_v_ndim / 2);
16401  __pyx_t_4 = __pyx_t_3;
16402  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16403  __pyx_v_i = __pyx_t_1;
16404 
16405  /* "View.MemoryView":952
16406  * cdef int i, j
16407  * for i in range(ndim / 2):
16408  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16409  * strides[i], strides[j] = strides[j], strides[i]
16410  * shape[i], shape[j] = shape[j], shape[i]
16411  */
16412  __Pyx_TraceLine(952,1,__PYX_ERR(1, 952, __pyx_L1_error))
16413  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16414 
16415  /* "View.MemoryView":953
16416  * for i in range(ndim / 2):
16417  * j = ndim - 1 - i
16418  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16419  * shape[i], shape[j] = shape[j], shape[i]
16420  *
16421  */
16422  __Pyx_TraceLine(953,1,__PYX_ERR(1, 953, __pyx_L1_error))
16423  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16424  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16425  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16426  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16427 
16428  /* "View.MemoryView":954
16429  * j = ndim - 1 - i
16430  * strides[i], strides[j] = strides[j], strides[i]
16431  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16432  *
16433  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16434  */
16435  __Pyx_TraceLine(954,1,__PYX_ERR(1, 954, __pyx_L1_error))
16436  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16437  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16438  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16439  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16440 
16441  /* "View.MemoryView":956
16442  * shape[i], shape[j] = shape[j], shape[i]
16443  *
16444  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16445  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16446  *
16447  */
16448  __Pyx_TraceLine(956,1,__PYX_ERR(1, 956, __pyx_L1_error))
16449  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16450  if (!__pyx_t_8) {
16451  } else {
16452  __pyx_t_7 = __pyx_t_8;
16453  goto __pyx_L6_bool_binop_done;
16454  }
16455  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16456  __pyx_t_7 = __pyx_t_8;
16457  __pyx_L6_bool_binop_done:;
16458  if (__pyx_t_7) {
16459 
16460  /* "View.MemoryView":957
16461  *
16462  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16463  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16464  *
16465  * return 1
16466  */
16467  __Pyx_TraceLine(957,1,__PYX_ERR(1, 957, __pyx_L1_error))
16468  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(1, 957, __pyx_L1_error)
16469 
16470  /* "View.MemoryView":956
16471  * shape[i], shape[j] = shape[j], shape[i]
16472  *
16473  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16474  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16475  *
16476  */
16477  }
16478  }
16479 
16480  /* "View.MemoryView":959
16481  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16482  *
16483  * return 1 # <<<<<<<<<<<<<<
16484  *
16485  *
16486  */
16487  __Pyx_TraceLine(959,1,__PYX_ERR(1, 959, __pyx_L1_error))
16488  __pyx_r = 1;
16489  goto __pyx_L0;
16490 
16491  /* "View.MemoryView":943
16492  *
16493  * @cname('__pyx_memslice_transpose')
16494  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16495  * cdef int ndim = memslice.memview.view.ndim
16496  *
16497  */
16498 
16499  /* function exit code */
16500  __pyx_L1_error:;
16501  {
16502  #ifdef WITH_THREAD
16503  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16504  #endif
16505  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16506  #ifdef WITH_THREAD
16507  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16508  #endif
16509  }
16510  __pyx_r = 0;
16511  __pyx_L0:;
16512  __Pyx_TraceReturn(Py_None, 1);
16513  return __pyx_r;
16514 }
16515 
16516 /* "View.MemoryView":976
16517  * cdef int (*to_dtype_func)(char *, object) except 0
16518  *
16519  * def __dealloc__(self): # <<<<<<<<<<<<<<
16520  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16521  *
16522  */
16523 
16524 /* Python wrapper */
16525 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16526 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16527  __Pyx_RefNannyDeclarations
16528  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16529  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16530 
16531  /* function exit code */
16532  __Pyx_RefNannyFinishContext();
16533 }
16534 
16535 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16536  __Pyx_TraceDeclarations
16537  __Pyx_RefNannyDeclarations
16538  int __pyx_lineno = 0;
16539  const char *__pyx_filename = NULL;
16540  int __pyx_clineno = 0;
16541  __Pyx_RefNannySetupContext("__dealloc__", 0);
16542  __Pyx_TraceCall("__dealloc__", __pyx_f[1], 976, 0, __PYX_ERR(1, 976, __pyx_L1_error));
16543 
16544  /* "View.MemoryView":977
16545  *
16546  * def __dealloc__(self):
16547  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16548  *
16549  * cdef convert_item_to_object(self, char *itemp):
16550  */
16551  __Pyx_TraceLine(977,0,__PYX_ERR(1, 977, __pyx_L1_error))
16552  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16553 
16554  /* "View.MemoryView":976
16555  * cdef int (*to_dtype_func)(char *, object) except 0
16556  *
16557  * def __dealloc__(self): # <<<<<<<<<<<<<<
16558  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16559  *
16560  */
16561 
16562  /* function exit code */
16563  goto __pyx_L0;
16564  __pyx_L1_error:;
16565  __Pyx_WriteUnraisable("View.MemoryView._memoryviewslice.__dealloc__", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
16566  __pyx_L0:;
16567  __Pyx_TraceReturn(Py_None, 0);
16568  __Pyx_RefNannyFinishContext();
16569 }
16570 
16571 /* "View.MemoryView":979
16572  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16573  *
16574  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16575  * if self.to_object_func != NULL:
16576  * return self.to_object_func(itemp)
16577  */
16578 
16579 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16580  PyObject *__pyx_r = NULL;
16581  __Pyx_TraceDeclarations
16582  __Pyx_RefNannyDeclarations
16583  int __pyx_t_1;
16584  PyObject *__pyx_t_2 = NULL;
16585  int __pyx_lineno = 0;
16586  const char *__pyx_filename = NULL;
16587  int __pyx_clineno = 0;
16588  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16589  __Pyx_TraceCall("convert_item_to_object", __pyx_f[1], 979, 0, __PYX_ERR(1, 979, __pyx_L1_error));
16590 
16591  /* "View.MemoryView":980
16592  *
16593  * cdef convert_item_to_object(self, char *itemp):
16594  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16595  * return self.to_object_func(itemp)
16596  * else:
16597  */
16598  __Pyx_TraceLine(980,0,__PYX_ERR(1, 980, __pyx_L1_error))
16599  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16600  if (__pyx_t_1) {
16601 
16602  /* "View.MemoryView":981
16603  * cdef convert_item_to_object(self, char *itemp):
16604  * if self.to_object_func != NULL:
16605  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16606  * else:
16607  * return memoryview.convert_item_to_object(self, itemp)
16608  */
16609  __Pyx_TraceLine(981,0,__PYX_ERR(1, 981, __pyx_L1_error))
16610  __Pyx_XDECREF(__pyx_r);
16611  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 981, __pyx_L1_error)
16612  __Pyx_GOTREF(__pyx_t_2);
16613  __pyx_r = __pyx_t_2;
16614  __pyx_t_2 = 0;
16615  goto __pyx_L0;
16616 
16617  /* "View.MemoryView":980
16618  *
16619  * cdef convert_item_to_object(self, char *itemp):
16620  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16621  * return self.to_object_func(itemp)
16622  * else:
16623  */
16624  }
16625 
16626  /* "View.MemoryView":983
16627  * return self.to_object_func(itemp)
16628  * else:
16629  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16630  *
16631  * cdef assign_item_from_object(self, char *itemp, object value):
16632  */
16633  __Pyx_TraceLine(983,0,__PYX_ERR(1, 983, __pyx_L1_error))
16634  /*else*/ {
16635  __Pyx_XDECREF(__pyx_r);
16636  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 983, __pyx_L1_error)
16637  __Pyx_GOTREF(__pyx_t_2);
16638  __pyx_r = __pyx_t_2;
16639  __pyx_t_2 = 0;
16640  goto __pyx_L0;
16641  }
16642 
16643  /* "View.MemoryView":979
16644  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16645  *
16646  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16647  * if self.to_object_func != NULL:
16648  * return self.to_object_func(itemp)
16649  */
16650 
16651  /* function exit code */
16652  __pyx_L1_error:;
16653  __Pyx_XDECREF(__pyx_t_2);
16654  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16655  __pyx_r = 0;
16656  __pyx_L0:;
16657  __Pyx_XGIVEREF(__pyx_r);
16658  __Pyx_TraceReturn(__pyx_r, 0);
16659  __Pyx_RefNannyFinishContext();
16660  return __pyx_r;
16661 }
16662 
16663 /* "View.MemoryView":985
16664  * return memoryview.convert_item_to_object(self, itemp)
16665  *
16666  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16667  * if self.to_dtype_func != NULL:
16668  * self.to_dtype_func(itemp, value)
16669  */
16670 
16671 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16672  PyObject *__pyx_r = NULL;
16673  __Pyx_TraceDeclarations
16674  __Pyx_RefNannyDeclarations
16675  int __pyx_t_1;
16676  int __pyx_t_2;
16677  PyObject *__pyx_t_3 = NULL;
16678  int __pyx_lineno = 0;
16679  const char *__pyx_filename = NULL;
16680  int __pyx_clineno = 0;
16681  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16682  __Pyx_TraceCall("assign_item_from_object", __pyx_f[1], 985, 0, __PYX_ERR(1, 985, __pyx_L1_error));
16683 
16684  /* "View.MemoryView":986
16685  *
16686  * cdef assign_item_from_object(self, char *itemp, object value):
16687  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16688  * self.to_dtype_func(itemp, value)
16689  * else:
16690  */
16691  __Pyx_TraceLine(986,0,__PYX_ERR(1, 986, __pyx_L1_error))
16692  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16693  if (__pyx_t_1) {
16694 
16695  /* "View.MemoryView":987
16696  * cdef assign_item_from_object(self, char *itemp, object value):
16697  * if self.to_dtype_func != NULL:
16698  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16699  * else:
16700  * memoryview.assign_item_from_object(self, itemp, value)
16701  */
16702  __Pyx_TraceLine(987,0,__PYX_ERR(1, 987, __pyx_L1_error))
16703  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 987, __pyx_L1_error)
16704 
16705  /* "View.MemoryView":986
16706  *
16707  * cdef assign_item_from_object(self, char *itemp, object value):
16708  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16709  * self.to_dtype_func(itemp, value)
16710  * else:
16711  */
16712  goto __pyx_L3;
16713  }
16714 
16715  /* "View.MemoryView":989
16716  * self.to_dtype_func(itemp, value)
16717  * else:
16718  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16719  *
16720  * @property
16721  */
16722  __Pyx_TraceLine(989,0,__PYX_ERR(1, 989, __pyx_L1_error))
16723  /*else*/ {
16724  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 989, __pyx_L1_error)
16725  __Pyx_GOTREF(__pyx_t_3);
16726  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16727  }
16728  __pyx_L3:;
16729 
16730  /* "View.MemoryView":985
16731  * return memoryview.convert_item_to_object(self, itemp)
16732  *
16733  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16734  * if self.to_dtype_func != NULL:
16735  * self.to_dtype_func(itemp, value)
16736  */
16737 
16738  /* function exit code */
16739  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16740  goto __pyx_L0;
16741  __pyx_L1_error:;
16742  __Pyx_XDECREF(__pyx_t_3);
16743  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16744  __pyx_r = 0;
16745  __pyx_L0:;
16746  __Pyx_XGIVEREF(__pyx_r);
16747  __Pyx_TraceReturn(__pyx_r, 0);
16748  __Pyx_RefNannyFinishContext();
16749  return __pyx_r;
16750 }
16751 
16752 /* "View.MemoryView":992
16753  *
16754  * @property
16755  * def base(self): # <<<<<<<<<<<<<<
16756  * return self.from_object
16757  *
16758  */
16759 
16760 /* Python wrapper */
16761 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16762 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16763  PyObject *__pyx_r = 0;
16764  __Pyx_RefNannyDeclarations
16765  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16766  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16767 
16768  /* function exit code */
16769  __Pyx_RefNannyFinishContext();
16770  return __pyx_r;
16771 }
16772 
16773 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16774  PyObject *__pyx_r = NULL;
16775  __Pyx_TraceDeclarations
16776  __Pyx_RefNannyDeclarations
16777  int __pyx_lineno = 0;
16778  const char *__pyx_filename = NULL;
16779  int __pyx_clineno = 0;
16780  __Pyx_RefNannySetupContext("__get__", 0);
16781  __Pyx_TraceCall("__get__", __pyx_f[1], 992, 0, __PYX_ERR(1, 992, __pyx_L1_error));
16782 
16783  /* "View.MemoryView":993
16784  * @property
16785  * def base(self):
16786  * return self.from_object # <<<<<<<<<<<<<<
16787  *
16788  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16789  */
16790  __Pyx_TraceLine(993,0,__PYX_ERR(1, 993, __pyx_L1_error))
16791  __Pyx_XDECREF(__pyx_r);
16792  __Pyx_INCREF(__pyx_v_self->from_object);
16793  __pyx_r = __pyx_v_self->from_object;
16794  goto __pyx_L0;
16795 
16796  /* "View.MemoryView":992
16797  *
16798  * @property
16799  * def base(self): # <<<<<<<<<<<<<<
16800  * return self.from_object
16801  *
16802  */
16803 
16804  /* function exit code */
16805  __pyx_L1_error:;
16806  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.base.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16807  __pyx_r = NULL;
16808  __pyx_L0:;
16809  __Pyx_XGIVEREF(__pyx_r);
16810  __Pyx_TraceReturn(__pyx_r, 0);
16811  __Pyx_RefNannyFinishContext();
16812  return __pyx_r;
16813 }
16814 
16815 /* "(tree fragment)":1
16816  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16817  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16818  * def __setstate_cython__(self, __pyx_state):
16819  */
16820 
16821 /* Python wrapper */
16822 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
16823 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
16824 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
16825  PyObject *__pyx_r = 0;
16826  __Pyx_RefNannyDeclarations
16827  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
16828  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16829 
16830  /* function exit code */
16831  __Pyx_RefNannyFinishContext();
16832  return __pyx_r;
16833 }
16834 
16835 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16836  PyObject *__pyx_r = NULL;
16837  __Pyx_TraceDeclarations
16838  __Pyx_RefNannyDeclarations
16839  PyObject *__pyx_t_1 = NULL;
16840  int __pyx_lineno = 0;
16841  const char *__pyx_filename = NULL;
16842  int __pyx_clineno = 0;
16843  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
16844  __Pyx_TraceCall("__reduce_cython__", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
16845 
16846  /* "(tree fragment)":2
16847  * def __reduce_cython__(self):
16848  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16849  * def __setstate_cython__(self, __pyx_state):
16850  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16851  */
16852  __Pyx_TraceLine(2,0,__PYX_ERR(1, 2, __pyx_L1_error))
16853  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 2, __pyx_L1_error)
16854  __Pyx_GOTREF(__pyx_t_1);
16855  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16856  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16857  __PYX_ERR(1, 2, __pyx_L1_error)
16858 
16859  /* "(tree fragment)":1
16860  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
16861  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16862  * def __setstate_cython__(self, __pyx_state):
16863  */
16864 
16865  /* function exit code */
16866  __pyx_L1_error:;
16867  __Pyx_XDECREF(__pyx_t_1);
16868  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16869  __pyx_r = NULL;
16870  __Pyx_XGIVEREF(__pyx_r);
16871  __Pyx_TraceReturn(__pyx_r, 0);
16872  __Pyx_RefNannyFinishContext();
16873  return __pyx_r;
16874 }
16875 
16876 /* "(tree fragment)":3
16877  * def __reduce_cython__(self):
16878  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16879  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16880  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16881  */
16882 
16883 /* Python wrapper */
16884 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
16885 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
16886 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
16887  PyObject *__pyx_r = 0;
16888  __Pyx_RefNannyDeclarations
16889  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
16890  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
16891 
16892  /* function exit code */
16893  __Pyx_RefNannyFinishContext();
16894  return __pyx_r;
16895 }
16896 
16897 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
16898  PyObject *__pyx_r = NULL;
16899  __Pyx_TraceDeclarations
16900  __Pyx_RefNannyDeclarations
16901  PyObject *__pyx_t_1 = NULL;
16902  int __pyx_lineno = 0;
16903  const char *__pyx_filename = NULL;
16904  int __pyx_clineno = 0;
16905  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
16906  __Pyx_TraceCall("__setstate_cython__", __pyx_f[1], 3, 0, __PYX_ERR(1, 3, __pyx_L1_error));
16907 
16908  /* "(tree fragment)":4
16909  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16910  * def __setstate_cython__(self, __pyx_state):
16911  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
16912  */
16913  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
16914  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 4, __pyx_L1_error)
16915  __Pyx_GOTREF(__pyx_t_1);
16916  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
16917  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
16918  __PYX_ERR(1, 4, __pyx_L1_error)
16919 
16920  /* "(tree fragment)":3
16921  * def __reduce_cython__(self):
16922  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16923  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
16924  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
16925  */
16926 
16927  /* function exit code */
16928  __pyx_L1_error:;
16929  __Pyx_XDECREF(__pyx_t_1);
16930  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
16931  __pyx_r = NULL;
16932  __Pyx_XGIVEREF(__pyx_r);
16933  __Pyx_TraceReturn(__pyx_r, 0);
16934  __Pyx_RefNannyFinishContext();
16935  return __pyx_r;
16936 }
16937 
16938 /* "View.MemoryView":999
16939  *
16940  * @cname('__pyx_memoryview_fromslice')
16941  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
16942  * int ndim,
16943  * object (*to_object_func)(char *),
16944  */
16945 
16946 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
16947  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
16948  Py_ssize_t __pyx_v_suboffset;
16949  PyObject *__pyx_v_length = NULL;
16950  PyObject *__pyx_r = NULL;
16951  __Pyx_TraceDeclarations
16952  __Pyx_RefNannyDeclarations
16953  int __pyx_t_1;
16954  PyObject *__pyx_t_2 = NULL;
16955  PyObject *__pyx_t_3 = NULL;
16956  __Pyx_TypeInfo *__pyx_t_4;
16957  Py_buffer __pyx_t_5;
16958  Py_ssize_t *__pyx_t_6;
16959  Py_ssize_t *__pyx_t_7;
16960  Py_ssize_t *__pyx_t_8;
16961  Py_ssize_t __pyx_t_9;
16962  int __pyx_lineno = 0;
16963  const char *__pyx_filename = NULL;
16964  int __pyx_clineno = 0;
16965  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
16966  __Pyx_TraceCall("memoryview_fromslice", __pyx_f[1], 999, 0, __PYX_ERR(1, 999, __pyx_L1_error));
16967 
16968  /* "View.MemoryView":1007
16969  * cdef _memoryviewslice result
16970  *
16971  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16972  * return None
16973  *
16974  */
16975  __Pyx_TraceLine(1007,0,__PYX_ERR(1, 1007, __pyx_L1_error))
16976  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
16977  if (__pyx_t_1) {
16978 
16979  /* "View.MemoryView":1008
16980  *
16981  * if <PyObject *> memviewslice.memview == Py_None:
16982  * return None # <<<<<<<<<<<<<<
16983  *
16984  *
16985  */
16986  __Pyx_TraceLine(1008,0,__PYX_ERR(1, 1008, __pyx_L1_error))
16987  __Pyx_XDECREF(__pyx_r);
16988  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16989  goto __pyx_L0;
16990 
16991  /* "View.MemoryView":1007
16992  * cdef _memoryviewslice result
16993  *
16994  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
16995  * return None
16996  *
16997  */
16998  }
16999 
17000  /* "View.MemoryView":1013
17001  *
17002  *
17003  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17004  *
17005  * result.from_slice = memviewslice
17006  */
17007  __Pyx_TraceLine(1013,0,__PYX_ERR(1, 1013, __pyx_L1_error))
17008  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17009  __Pyx_GOTREF(__pyx_t_2);
17010  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1013, __pyx_L1_error)
17011  __Pyx_GOTREF(__pyx_t_3);
17012  __Pyx_INCREF(Py_None);
17013  __Pyx_GIVEREF(Py_None);
17014  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17015  __Pyx_INCREF(__pyx_int_0);
17016  __Pyx_GIVEREF(__pyx_int_0);
17017  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17018  __Pyx_GIVEREF(__pyx_t_2);
17019  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17020  __pyx_t_2 = 0;
17021  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1013, __pyx_L1_error)
17022  __Pyx_GOTREF(__pyx_t_2);
17023  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17024  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17025  __pyx_t_2 = 0;
17026 
17027  /* "View.MemoryView":1015
17028  * result = _memoryviewslice(None, 0, dtype_is_object)
17029  *
17030  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17031  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17032  *
17033  */
17034  __Pyx_TraceLine(1015,0,__PYX_ERR(1, 1015, __pyx_L1_error))
17035  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17036 
17037  /* "View.MemoryView":1016
17038  *
17039  * result.from_slice = memviewslice
17040  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17041  *
17042  * result.from_object = (<memoryview> memviewslice.memview).base
17043  */
17044  __Pyx_TraceLine(1016,0,__PYX_ERR(1, 1016, __pyx_L1_error))
17045  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17046 
17047  /* "View.MemoryView":1018
17048  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17049  *
17050  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17051  * result.typeinfo = memviewslice.memview.typeinfo
17052  *
17053  */
17054  __Pyx_TraceLine(1018,0,__PYX_ERR(1, 1018, __pyx_L1_error))
17055  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1018, __pyx_L1_error)
17056  __Pyx_GOTREF(__pyx_t_2);
17057  __Pyx_GIVEREF(__pyx_t_2);
17058  __Pyx_GOTREF(__pyx_v_result->from_object);
17059  __Pyx_DECREF(__pyx_v_result->from_object);
17060  __pyx_v_result->from_object = __pyx_t_2;
17061  __pyx_t_2 = 0;
17062 
17063  /* "View.MemoryView":1019
17064  *
17065  * result.from_object = (<memoryview> memviewslice.memview).base
17066  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17067  *
17068  * result.view = memviewslice.memview.view
17069  */
17070  __Pyx_TraceLine(1019,0,__PYX_ERR(1, 1019, __pyx_L1_error))
17071  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17072  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17073 
17074  /* "View.MemoryView":1021
17075  * result.typeinfo = memviewslice.memview.typeinfo
17076  *
17077  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17078  * result.view.buf = <void *> memviewslice.data
17079  * result.view.ndim = ndim
17080  */
17081  __Pyx_TraceLine(1021,0,__PYX_ERR(1, 1021, __pyx_L1_error))
17082  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17083  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17084 
17085  /* "View.MemoryView":1022
17086  *
17087  * result.view = memviewslice.memview.view
17088  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17089  * result.view.ndim = ndim
17090  * (<__pyx_buffer *> &result.view).obj = Py_None
17091  */
17092  __Pyx_TraceLine(1022,0,__PYX_ERR(1, 1022, __pyx_L1_error))
17093  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17094 
17095  /* "View.MemoryView":1023
17096  * result.view = memviewslice.memview.view
17097  * result.view.buf = <void *> memviewslice.data
17098  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17099  * (<__pyx_buffer *> &result.view).obj = Py_None
17100  * Py_INCREF(Py_None)
17101  */
17102  __Pyx_TraceLine(1023,0,__PYX_ERR(1, 1023, __pyx_L1_error))
17103  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17104 
17105  /* "View.MemoryView":1024
17106  * result.view.buf = <void *> memviewslice.data
17107  * result.view.ndim = ndim
17108  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17109  * Py_INCREF(Py_None)
17110  *
17111  */
17112  __Pyx_TraceLine(1024,0,__PYX_ERR(1, 1024, __pyx_L1_error))
17113  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17114 
17115  /* "View.MemoryView":1025
17116  * result.view.ndim = ndim
17117  * (<__pyx_buffer *> &result.view).obj = Py_None
17118  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17119  *
17120  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17121  */
17122  __Pyx_TraceLine(1025,0,__PYX_ERR(1, 1025, __pyx_L1_error))
17123  Py_INCREF(Py_None);
17124 
17125  /* "View.MemoryView":1027
17126  * Py_INCREF(Py_None)
17127  *
17128  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17129  * result.flags = PyBUF_RECORDS
17130  * else:
17131  */
17132  __Pyx_TraceLine(1027,0,__PYX_ERR(1, 1027, __pyx_L1_error))
17133  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17134  if (__pyx_t_1) {
17135 
17136  /* "View.MemoryView":1028
17137  *
17138  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17139  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17140  * else:
17141  * result.flags = PyBUF_RECORDS_RO
17142  */
17143  __Pyx_TraceLine(1028,0,__PYX_ERR(1, 1028, __pyx_L1_error))
17144  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17145 
17146  /* "View.MemoryView":1027
17147  * Py_INCREF(Py_None)
17148  *
17149  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17150  * result.flags = PyBUF_RECORDS
17151  * else:
17152  */
17153  goto __pyx_L4;
17154  }
17155 
17156  /* "View.MemoryView":1030
17157  * result.flags = PyBUF_RECORDS
17158  * else:
17159  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17160  *
17161  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17162  */
17163  __Pyx_TraceLine(1030,0,__PYX_ERR(1, 1030, __pyx_L1_error))
17164  /*else*/ {
17165  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17166  }
17167  __pyx_L4:;
17168 
17169  /* "View.MemoryView":1032
17170  * result.flags = PyBUF_RECORDS_RO
17171  *
17172  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17173  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17174  *
17175  */
17176  __Pyx_TraceLine(1032,0,__PYX_ERR(1, 1032, __pyx_L1_error))
17177  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17178 
17179  /* "View.MemoryView":1033
17180  *
17181  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17182  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17183  *
17184  *
17185  */
17186  __Pyx_TraceLine(1033,0,__PYX_ERR(1, 1033, __pyx_L1_error))
17187  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17188 
17189  /* "View.MemoryView":1036
17190  *
17191  *
17192  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17193  * for suboffset in result.from_slice.suboffsets[:ndim]:
17194  * if suboffset >= 0:
17195  */
17196  __Pyx_TraceLine(1036,0,__PYX_ERR(1, 1036, __pyx_L1_error))
17197  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17198 
17199  /* "View.MemoryView":1037
17200  *
17201  * result.view.suboffsets = NULL
17202  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17203  * if suboffset >= 0:
17204  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17205  */
17206  __Pyx_TraceLine(1037,0,__PYX_ERR(1, 1037, __pyx_L1_error))
17207  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17208  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17209  __pyx_t_6 = __pyx_t_8;
17210  __pyx_v_suboffset = (__pyx_t_6[0]);
17211 
17212  /* "View.MemoryView":1038
17213  * result.view.suboffsets = NULL
17214  * for suboffset in result.from_slice.suboffsets[:ndim]:
17215  * if suboffset >= 0: # <<<<<<<<<<<<<<
17216  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17217  * break
17218  */
17219  __Pyx_TraceLine(1038,0,__PYX_ERR(1, 1038, __pyx_L1_error))
17220  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17221  if (__pyx_t_1) {
17222 
17223  /* "View.MemoryView":1039
17224  * for suboffset in result.from_slice.suboffsets[:ndim]:
17225  * if suboffset >= 0:
17226  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17227  * break
17228  *
17229  */
17230  __Pyx_TraceLine(1039,0,__PYX_ERR(1, 1039, __pyx_L1_error))
17231  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17232 
17233  /* "View.MemoryView":1040
17234  * if suboffset >= 0:
17235  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17236  * break # <<<<<<<<<<<<<<
17237  *
17238  * result.view.len = result.view.itemsize
17239  */
17240  __Pyx_TraceLine(1040,0,__PYX_ERR(1, 1040, __pyx_L1_error))
17241  goto __pyx_L6_break;
17242 
17243  /* "View.MemoryView":1038
17244  * result.view.suboffsets = NULL
17245  * for suboffset in result.from_slice.suboffsets[:ndim]:
17246  * if suboffset >= 0: # <<<<<<<<<<<<<<
17247  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17248  * break
17249  */
17250  }
17251  }
17252  __pyx_L6_break:;
17253 
17254  /* "View.MemoryView":1042
17255  * break
17256  *
17257  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17258  * for length in result.view.shape[:ndim]:
17259  * result.view.len *= length
17260  */
17261  __Pyx_TraceLine(1042,0,__PYX_ERR(1, 1042, __pyx_L1_error))
17262  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17263  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17264 
17265  /* "View.MemoryView":1043
17266  *
17267  * result.view.len = result.view.itemsize
17268  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17269  * result.view.len *= length
17270  *
17271  */
17272  __Pyx_TraceLine(1043,0,__PYX_ERR(1, 1043, __pyx_L1_error))
17273  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17274  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17275  __pyx_t_6 = __pyx_t_8;
17276  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1043, __pyx_L1_error)
17277  __Pyx_GOTREF(__pyx_t_2);
17278  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17279  __pyx_t_2 = 0;
17280 
17281  /* "View.MemoryView":1044
17282  * result.view.len = result.view.itemsize
17283  * for length in result.view.shape[:ndim]:
17284  * result.view.len *= length # <<<<<<<<<<<<<<
17285  *
17286  * result.to_object_func = to_object_func
17287  */
17288  __Pyx_TraceLine(1044,0,__PYX_ERR(1, 1044, __pyx_L1_error))
17289  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1044, __pyx_L1_error)
17290  __Pyx_GOTREF(__pyx_t_2);
17291  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1044, __pyx_L1_error)
17292  __Pyx_GOTREF(__pyx_t_3);
17293  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17294  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(1, 1044, __pyx_L1_error)
17295  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17296  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17297  }
17298 
17299  /* "View.MemoryView":1046
17300  * result.view.len *= length
17301  *
17302  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17303  * result.to_dtype_func = to_dtype_func
17304  *
17305  */
17306  __Pyx_TraceLine(1046,0,__PYX_ERR(1, 1046, __pyx_L1_error))
17307  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17308 
17309  /* "View.MemoryView":1047
17310  *
17311  * result.to_object_func = to_object_func
17312  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17313  *
17314  * return result
17315  */
17316  __Pyx_TraceLine(1047,0,__PYX_ERR(1, 1047, __pyx_L1_error))
17317  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17318 
17319  /* "View.MemoryView":1049
17320  * result.to_dtype_func = to_dtype_func
17321  *
17322  * return result # <<<<<<<<<<<<<<
17323  *
17324  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17325  */
17326  __Pyx_TraceLine(1049,0,__PYX_ERR(1, 1049, __pyx_L1_error))
17327  __Pyx_XDECREF(__pyx_r);
17328  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17329  __pyx_r = ((PyObject *)__pyx_v_result);
17330  goto __pyx_L0;
17331 
17332  /* "View.MemoryView":999
17333  *
17334  * @cname('__pyx_memoryview_fromslice')
17335  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17336  * int ndim,
17337  * object (*to_object_func)(char *),
17338  */
17339 
17340  /* function exit code */
17341  __pyx_L1_error:;
17342  __Pyx_XDECREF(__pyx_t_2);
17343  __Pyx_XDECREF(__pyx_t_3);
17344  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17345  __pyx_r = 0;
17346  __pyx_L0:;
17347  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17348  __Pyx_XDECREF(__pyx_v_length);
17349  __Pyx_XGIVEREF(__pyx_r);
17350  __Pyx_TraceReturn(__pyx_r, 0);
17351  __Pyx_RefNannyFinishContext();
17352  return __pyx_r;
17353 }
17354 
17355 /* "View.MemoryView":1052
17356  *
17357  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17358  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17359  * __Pyx_memviewslice *mslice) except NULL:
17360  * cdef _memoryviewslice obj
17361  */
17362 
17363 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17364  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17365  __Pyx_memviewslice *__pyx_r;
17366  __Pyx_TraceDeclarations
17367  __Pyx_RefNannyDeclarations
17368  int __pyx_t_1;
17369  int __pyx_t_2;
17370  PyObject *__pyx_t_3 = NULL;
17371  int __pyx_lineno = 0;
17372  const char *__pyx_filename = NULL;
17373  int __pyx_clineno = 0;
17374  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17375  __Pyx_TraceCall("get_slice_from_memview", __pyx_f[1], 1052, 0, __PYX_ERR(1, 1052, __pyx_L1_error));
17376 
17377  /* "View.MemoryView":1055
17378  * __Pyx_memviewslice *mslice) except NULL:
17379  * cdef _memoryviewslice obj
17380  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17381  * obj = memview
17382  * return &obj.from_slice
17383  */
17384  __Pyx_TraceLine(1055,0,__PYX_ERR(1, 1055, __pyx_L1_error))
17385  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17386  __pyx_t_2 = (__pyx_t_1 != 0);
17387  if (__pyx_t_2) {
17388 
17389  /* "View.MemoryView":1056
17390  * cdef _memoryviewslice obj
17391  * if isinstance(memview, _memoryviewslice):
17392  * obj = memview # <<<<<<<<<<<<<<
17393  * return &obj.from_slice
17394  * else:
17395  */
17396  __Pyx_TraceLine(1056,0,__PYX_ERR(1, 1056, __pyx_L1_error))
17397  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(1, 1056, __pyx_L1_error)
17398  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17399  __Pyx_INCREF(__pyx_t_3);
17400  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17401  __pyx_t_3 = 0;
17402 
17403  /* "View.MemoryView":1057
17404  * if isinstance(memview, _memoryviewslice):
17405  * obj = memview
17406  * return &obj.from_slice # <<<<<<<<<<<<<<
17407  * else:
17408  * slice_copy(memview, mslice)
17409  */
17410  __Pyx_TraceLine(1057,0,__PYX_ERR(1, 1057, __pyx_L1_error))
17411  __pyx_r = (&__pyx_v_obj->from_slice);
17412  goto __pyx_L0;
17413 
17414  /* "View.MemoryView":1055
17415  * __Pyx_memviewslice *mslice) except NULL:
17416  * cdef _memoryviewslice obj
17417  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17418  * obj = memview
17419  * return &obj.from_slice
17420  */
17421  }
17422 
17423  /* "View.MemoryView":1059
17424  * return &obj.from_slice
17425  * else:
17426  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17427  * return mslice
17428  *
17429  */
17430  __Pyx_TraceLine(1059,0,__PYX_ERR(1, 1059, __pyx_L1_error))
17431  /*else*/ {
17432  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17433 
17434  /* "View.MemoryView":1060
17435  * else:
17436  * slice_copy(memview, mslice)
17437  * return mslice # <<<<<<<<<<<<<<
17438  *
17439  * @cname('__pyx_memoryview_slice_copy')
17440  */
17441  __Pyx_TraceLine(1060,0,__PYX_ERR(1, 1060, __pyx_L1_error))
17442  __pyx_r = __pyx_v_mslice;
17443  goto __pyx_L0;
17444  }
17445 
17446  /* "View.MemoryView":1052
17447  *
17448  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17449  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17450  * __Pyx_memviewslice *mslice) except NULL:
17451  * cdef _memoryviewslice obj
17452  */
17453 
17454  /* function exit code */
17455  __pyx_L1_error:;
17456  __Pyx_XDECREF(__pyx_t_3);
17457  __Pyx_AddTraceback("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
17458  __pyx_r = NULL;
17459  __pyx_L0:;
17460  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17461  __Pyx_TraceReturn(Py_None, 0);
17462  __Pyx_RefNannyFinishContext();
17463  return __pyx_r;
17464 }
17465 
17466 /* "View.MemoryView":1063
17467  *
17468  * @cname('__pyx_memoryview_slice_copy')
17469  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17470  * cdef int dim
17471  * cdef (Py_ssize_t*) shape, strides, suboffsets
17472  */
17473 
17474 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17475  int __pyx_v_dim;
17476  Py_ssize_t *__pyx_v_shape;
17477  Py_ssize_t *__pyx_v_strides;
17478  Py_ssize_t *__pyx_v_suboffsets;
17479  __Pyx_TraceDeclarations
17480  __Pyx_RefNannyDeclarations
17481  Py_ssize_t *__pyx_t_1;
17482  int __pyx_t_2;
17483  int __pyx_t_3;
17484  int __pyx_t_4;
17485  Py_ssize_t __pyx_t_5;
17486  int __pyx_lineno = 0;
17487  const char *__pyx_filename = NULL;
17488  int __pyx_clineno = 0;
17489  __Pyx_RefNannySetupContext("slice_copy", 0);
17490  __Pyx_TraceCall("slice_copy", __pyx_f[1], 1063, 0, __PYX_ERR(1, 1063, __pyx_L1_error));
17491 
17492  /* "View.MemoryView":1067
17493  * cdef (Py_ssize_t*) shape, strides, suboffsets
17494  *
17495  * shape = memview.view.shape # <<<<<<<<<<<<<<
17496  * strides = memview.view.strides
17497  * suboffsets = memview.view.suboffsets
17498  */
17499  __Pyx_TraceLine(1067,0,__PYX_ERR(1, 1067, __pyx_L1_error))
17500  __pyx_t_1 = __pyx_v_memview->view.shape;
17501  __pyx_v_shape = __pyx_t_1;
17502 
17503  /* "View.MemoryView":1068
17504  *
17505  * shape = memview.view.shape
17506  * strides = memview.view.strides # <<<<<<<<<<<<<<
17507  * suboffsets = memview.view.suboffsets
17508  *
17509  */
17510  __Pyx_TraceLine(1068,0,__PYX_ERR(1, 1068, __pyx_L1_error))
17511  __pyx_t_1 = __pyx_v_memview->view.strides;
17512  __pyx_v_strides = __pyx_t_1;
17513 
17514  /* "View.MemoryView":1069
17515  * shape = memview.view.shape
17516  * strides = memview.view.strides
17517  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17518  *
17519  * dst.memview = <__pyx_memoryview *> memview
17520  */
17521  __Pyx_TraceLine(1069,0,__PYX_ERR(1, 1069, __pyx_L1_error))
17522  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17523  __pyx_v_suboffsets = __pyx_t_1;
17524 
17525  /* "View.MemoryView":1071
17526  * suboffsets = memview.view.suboffsets
17527  *
17528  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17529  * dst.data = <char *> memview.view.buf
17530  *
17531  */
17532  __Pyx_TraceLine(1071,0,__PYX_ERR(1, 1071, __pyx_L1_error))
17533  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17534 
17535  /* "View.MemoryView":1072
17536  *
17537  * dst.memview = <__pyx_memoryview *> memview
17538  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17539  *
17540  * for dim in range(memview.view.ndim):
17541  */
17542  __Pyx_TraceLine(1072,0,__PYX_ERR(1, 1072, __pyx_L1_error))
17543  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17544 
17545  /* "View.MemoryView":1074
17546  * dst.data = <char *> memview.view.buf
17547  *
17548  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17549  * dst.shape[dim] = shape[dim]
17550  * dst.strides[dim] = strides[dim]
17551  */
17552  __Pyx_TraceLine(1074,0,__PYX_ERR(1, 1074, __pyx_L1_error))
17553  __pyx_t_2 = __pyx_v_memview->view.ndim;
17554  __pyx_t_3 = __pyx_t_2;
17555  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17556  __pyx_v_dim = __pyx_t_4;
17557 
17558  /* "View.MemoryView":1075
17559  *
17560  * for dim in range(memview.view.ndim):
17561  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17562  * dst.strides[dim] = strides[dim]
17563  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17564  */
17565  __Pyx_TraceLine(1075,0,__PYX_ERR(1, 1075, __pyx_L1_error))
17566  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17567 
17568  /* "View.MemoryView":1076
17569  * for dim in range(memview.view.ndim):
17570  * dst.shape[dim] = shape[dim]
17571  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17572  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17573  *
17574  */
17575  __Pyx_TraceLine(1076,0,__PYX_ERR(1, 1076, __pyx_L1_error))
17576  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17577 
17578  /* "View.MemoryView":1077
17579  * dst.shape[dim] = shape[dim]
17580  * dst.strides[dim] = strides[dim]
17581  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17582  *
17583  * @cname('__pyx_memoryview_copy_object')
17584  */
17585  __Pyx_TraceLine(1077,0,__PYX_ERR(1, 1077, __pyx_L1_error))
17586  if ((__pyx_v_suboffsets != 0)) {
17587  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17588  } else {
17589  __pyx_t_5 = -1L;
17590  }
17591  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17592  }
17593 
17594  /* "View.MemoryView":1063
17595  *
17596  * @cname('__pyx_memoryview_slice_copy')
17597  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17598  * cdef int dim
17599  * cdef (Py_ssize_t*) shape, strides, suboffsets
17600  */
17601 
17602  /* function exit code */
17603  goto __pyx_L0;
17604  __pyx_L1_error:;
17605  __Pyx_WriteUnraisable("View.MemoryView.slice_copy", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17606  __pyx_L0:;
17607  __Pyx_TraceReturn(Py_None, 0);
17608  __Pyx_RefNannyFinishContext();
17609 }
17610 
17611 /* "View.MemoryView":1080
17612  *
17613  * @cname('__pyx_memoryview_copy_object')
17614  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17615  * "Create a new memoryview object"
17616  * cdef __Pyx_memviewslice memviewslice
17617  */
17618 
17619 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17620  __Pyx_memviewslice __pyx_v_memviewslice;
17621  PyObject *__pyx_r = NULL;
17622  __Pyx_TraceDeclarations
17623  __Pyx_RefNannyDeclarations
17624  PyObject *__pyx_t_1 = NULL;
17625  int __pyx_lineno = 0;
17626  const char *__pyx_filename = NULL;
17627  int __pyx_clineno = 0;
17628  __Pyx_RefNannySetupContext("memoryview_copy", 0);
17629  __Pyx_TraceCall("memoryview_copy", __pyx_f[1], 1080, 0, __PYX_ERR(1, 1080, __pyx_L1_error));
17630 
17631  /* "View.MemoryView":1083
17632  * "Create a new memoryview object"
17633  * cdef __Pyx_memviewslice memviewslice
17634  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17635  * return memoryview_copy_from_slice(memview, &memviewslice)
17636  *
17637  */
17638  __Pyx_TraceLine(1083,0,__PYX_ERR(1, 1083, __pyx_L1_error))
17639  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17640 
17641  /* "View.MemoryView":1084
17642  * cdef __Pyx_memviewslice memviewslice
17643  * slice_copy(memview, &memviewslice)
17644  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17645  *
17646  * @cname('__pyx_memoryview_copy_object_from_slice')
17647  */
17648  __Pyx_TraceLine(1084,0,__PYX_ERR(1, 1084, __pyx_L1_error))
17649  __Pyx_XDECREF(__pyx_r);
17650  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1084, __pyx_L1_error)
17651  __Pyx_GOTREF(__pyx_t_1);
17652  __pyx_r = __pyx_t_1;
17653  __pyx_t_1 = 0;
17654  goto __pyx_L0;
17655 
17656  /* "View.MemoryView":1080
17657  *
17658  * @cname('__pyx_memoryview_copy_object')
17659  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17660  * "Create a new memoryview object"
17661  * cdef __Pyx_memviewslice memviewslice
17662  */
17663 
17664  /* function exit code */
17665  __pyx_L1_error:;
17666  __Pyx_XDECREF(__pyx_t_1);
17667  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17668  __pyx_r = 0;
17669  __pyx_L0:;
17670  __Pyx_XGIVEREF(__pyx_r);
17671  __Pyx_TraceReturn(__pyx_r, 0);
17672  __Pyx_RefNannyFinishContext();
17673  return __pyx_r;
17674 }
17675 
17676 /* "View.MemoryView":1087
17677  *
17678  * @cname('__pyx_memoryview_copy_object_from_slice')
17679  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17680  * """
17681  * Create a new memoryview object from a given memoryview object and slice.
17682  */
17683 
17684 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17685  PyObject *(*__pyx_v_to_object_func)(char *);
17686  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17687  PyObject *__pyx_r = NULL;
17688  __Pyx_TraceDeclarations
17689  __Pyx_RefNannyDeclarations
17690  int __pyx_t_1;
17691  int __pyx_t_2;
17692  PyObject *(*__pyx_t_3)(char *);
17693  int (*__pyx_t_4)(char *, PyObject *);
17694  PyObject *__pyx_t_5 = NULL;
17695  int __pyx_lineno = 0;
17696  const char *__pyx_filename = NULL;
17697  int __pyx_clineno = 0;
17698  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17699  __Pyx_TraceCall("memoryview_copy_from_slice", __pyx_f[1], 1087, 0, __PYX_ERR(1, 1087, __pyx_L1_error));
17700 
17701  /* "View.MemoryView":1094
17702  * cdef int (*to_dtype_func)(char *, object) except 0
17703  *
17704  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17705  * to_object_func = (<_memoryviewslice> memview).to_object_func
17706  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17707  */
17708  __Pyx_TraceLine(1094,0,__PYX_ERR(1, 1094, __pyx_L1_error))
17709  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17710  __pyx_t_2 = (__pyx_t_1 != 0);
17711  if (__pyx_t_2) {
17712 
17713  /* "View.MemoryView":1095
17714  *
17715  * if isinstance(memview, _memoryviewslice):
17716  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17717  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17718  * else:
17719  */
17720  __Pyx_TraceLine(1095,0,__PYX_ERR(1, 1095, __pyx_L1_error))
17721  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17722  __pyx_v_to_object_func = __pyx_t_3;
17723 
17724  /* "View.MemoryView":1096
17725  * if isinstance(memview, _memoryviewslice):
17726  * to_object_func = (<_memoryviewslice> memview).to_object_func
17727  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17728  * else:
17729  * to_object_func = NULL
17730  */
17731  __Pyx_TraceLine(1096,0,__PYX_ERR(1, 1096, __pyx_L1_error))
17732  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17733  __pyx_v_to_dtype_func = __pyx_t_4;
17734 
17735  /* "View.MemoryView":1094
17736  * cdef int (*to_dtype_func)(char *, object) except 0
17737  *
17738  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17739  * to_object_func = (<_memoryviewslice> memview).to_object_func
17740  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17741  */
17742  goto __pyx_L3;
17743  }
17744 
17745  /* "View.MemoryView":1098
17746  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17747  * else:
17748  * to_object_func = NULL # <<<<<<<<<<<<<<
17749  * to_dtype_func = NULL
17750  *
17751  */
17752  __Pyx_TraceLine(1098,0,__PYX_ERR(1, 1098, __pyx_L1_error))
17753  /*else*/ {
17754  __pyx_v_to_object_func = NULL;
17755 
17756  /* "View.MemoryView":1099
17757  * else:
17758  * to_object_func = NULL
17759  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17760  *
17761  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17762  */
17763  __Pyx_TraceLine(1099,0,__PYX_ERR(1, 1099, __pyx_L1_error))
17764  __pyx_v_to_dtype_func = NULL;
17765  }
17766  __pyx_L3:;
17767 
17768  /* "View.MemoryView":1101
17769  * to_dtype_func = NULL
17770  *
17771  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17772  * to_object_func, to_dtype_func,
17773  * memview.dtype_is_object)
17774  */
17775  __Pyx_TraceLine(1101,0,__PYX_ERR(1, 1101, __pyx_L1_error))
17776  __Pyx_XDECREF(__pyx_r);
17777 
17778  /* "View.MemoryView":1103
17779  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17780  * to_object_func, to_dtype_func,
17781  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17782  *
17783  *
17784  */
17785  __Pyx_TraceLine(1103,0,__PYX_ERR(1, 1103, __pyx_L1_error))
17786  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 1101, __pyx_L1_error)
17787  __Pyx_GOTREF(__pyx_t_5);
17788  __pyx_r = __pyx_t_5;
17789  __pyx_t_5 = 0;
17790  goto __pyx_L0;
17791 
17792  /* "View.MemoryView":1087
17793  *
17794  * @cname('__pyx_memoryview_copy_object_from_slice')
17795  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17796  * """
17797  * Create a new memoryview object from a given memoryview object and slice.
17798  */
17799 
17800  /* function exit code */
17801  __pyx_L1_error:;
17802  __Pyx_XDECREF(__pyx_t_5);
17803  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17804  __pyx_r = 0;
17805  __pyx_L0:;
17806  __Pyx_XGIVEREF(__pyx_r);
17807  __Pyx_TraceReturn(__pyx_r, 0);
17808  __Pyx_RefNannyFinishContext();
17809  return __pyx_r;
17810 }
17811 
17812 /* "View.MemoryView":1109
17813  *
17814  *
17815  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17816  * if arg < 0:
17817  * return -arg
17818  */
17819 
17820 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17821  Py_ssize_t __pyx_r;
17822  __Pyx_TraceDeclarations
17823  int __pyx_t_1;
17824  int __pyx_lineno = 0;
17825  const char *__pyx_filename = NULL;
17826  int __pyx_clineno = 0;
17827  __Pyx_TraceCall("abs_py_ssize_t", __pyx_f[1], 1109, 1, __PYX_ERR(1, 1109, __pyx_L1_error));
17828 
17829  /* "View.MemoryView":1110
17830  *
17831  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17832  * if arg < 0: # <<<<<<<<<<<<<<
17833  * return -arg
17834  * else:
17835  */
17836  __Pyx_TraceLine(1110,1,__PYX_ERR(1, 1110, __pyx_L1_error))
17837  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17838  if (__pyx_t_1) {
17839 
17840  /* "View.MemoryView":1111
17841  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17842  * if arg < 0:
17843  * return -arg # <<<<<<<<<<<<<<
17844  * else:
17845  * return arg
17846  */
17847  __Pyx_TraceLine(1111,1,__PYX_ERR(1, 1111, __pyx_L1_error))
17848  __pyx_r = (-__pyx_v_arg);
17849  goto __pyx_L0;
17850 
17851  /* "View.MemoryView":1110
17852  *
17853  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17854  * if arg < 0: # <<<<<<<<<<<<<<
17855  * return -arg
17856  * else:
17857  */
17858  }
17859 
17860  /* "View.MemoryView":1113
17861  * return -arg
17862  * else:
17863  * return arg # <<<<<<<<<<<<<<
17864  *
17865  * @cname('__pyx_get_best_slice_order')
17866  */
17867  __Pyx_TraceLine(1113,1,__PYX_ERR(1, 1113, __pyx_L1_error))
17868  /*else*/ {
17869  __pyx_r = __pyx_v_arg;
17870  goto __pyx_L0;
17871  }
17872 
17873  /* "View.MemoryView":1109
17874  *
17875  *
17876  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17877  * if arg < 0:
17878  * return -arg
17879  */
17880 
17881  /* function exit code */
17882  __pyx_L1_error:;
17883  __Pyx_WriteUnraisable("View.MemoryView.abs_py_ssize_t", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
17884  __pyx_r = 0;
17885  __pyx_L0:;
17886  __Pyx_TraceReturn(Py_None, 1);
17887  return __pyx_r;
17888 }
17889 
17890 /* "View.MemoryView":1116
17891  *
17892  * @cname('__pyx_get_best_slice_order')
17893  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17894  * """
17895  * Figure out the best memory access order for a given slice.
17896  */
17897 
17898 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17899  int __pyx_v_i;
17900  Py_ssize_t __pyx_v_c_stride;
17901  Py_ssize_t __pyx_v_f_stride;
17902  char __pyx_r;
17903  __Pyx_TraceDeclarations
17904  int __pyx_t_1;
17905  int __pyx_t_2;
17906  int __pyx_t_3;
17907  int __pyx_t_4;
17908  int __pyx_lineno = 0;
17909  const char *__pyx_filename = NULL;
17910  int __pyx_clineno = 0;
17911  __Pyx_TraceCall("get_best_order", __pyx_f[1], 1116, 1, __PYX_ERR(1, 1116, __pyx_L1_error));
17912 
17913  /* "View.MemoryView":1121
17914  * """
17915  * cdef int i
17916  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17917  * cdef Py_ssize_t f_stride = 0
17918  *
17919  */
17920  __Pyx_TraceLine(1121,1,__PYX_ERR(1, 1121, __pyx_L1_error))
17921  __pyx_v_c_stride = 0;
17922 
17923  /* "View.MemoryView":1122
17924  * cdef int i
17925  * cdef Py_ssize_t c_stride = 0
17926  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
17927  *
17928  * for i in range(ndim - 1, -1, -1):
17929  */
17930  __Pyx_TraceLine(1122,1,__PYX_ERR(1, 1122, __pyx_L1_error))
17931  __pyx_v_f_stride = 0;
17932 
17933  /* "View.MemoryView":1124
17934  * cdef Py_ssize_t f_stride = 0
17935  *
17936  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
17937  * if mslice.shape[i] > 1:
17938  * c_stride = mslice.strides[i]
17939  */
17940  __Pyx_TraceLine(1124,1,__PYX_ERR(1, 1124, __pyx_L1_error))
17941  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
17942  __pyx_v_i = __pyx_t_1;
17943 
17944  /* "View.MemoryView":1125
17945  *
17946  * for i in range(ndim - 1, -1, -1):
17947  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17948  * c_stride = mslice.strides[i]
17949  * break
17950  */
17951  __Pyx_TraceLine(1125,1,__PYX_ERR(1, 1125, __pyx_L1_error))
17952  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
17953  if (__pyx_t_2) {
17954 
17955  /* "View.MemoryView":1126
17956  * for i in range(ndim - 1, -1, -1):
17957  * if mslice.shape[i] > 1:
17958  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
17959  * break
17960  *
17961  */
17962  __Pyx_TraceLine(1126,1,__PYX_ERR(1, 1126, __pyx_L1_error))
17963  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
17964 
17965  /* "View.MemoryView":1127
17966  * if mslice.shape[i] > 1:
17967  * c_stride = mslice.strides[i]
17968  * break # <<<<<<<<<<<<<<
17969  *
17970  * for i in range(ndim):
17971  */
17972  __Pyx_TraceLine(1127,1,__PYX_ERR(1, 1127, __pyx_L1_error))
17973  goto __pyx_L4_break;
17974 
17975  /* "View.MemoryView":1125
17976  *
17977  * for i in range(ndim - 1, -1, -1):
17978  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
17979  * c_stride = mslice.strides[i]
17980  * break
17981  */
17982  }
17983  }
17984  __pyx_L4_break:;
17985 
17986  /* "View.MemoryView":1129
17987  * break
17988  *
17989  * for i in range(ndim): # <<<<<<<<<<<<<<
17990  * if mslice.shape[i] > 1:
17991  * f_stride = mslice.strides[i]
17992  */
17993  __Pyx_TraceLine(1129,1,__PYX_ERR(1, 1129, __pyx_L1_error))
17994  __pyx_t_1 = __pyx_v_ndim;
17995  __pyx_t_3 = __pyx_t_1;
17996  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17997  __pyx_v_i = __pyx_t_4;
17998 
17999  /* "View.MemoryView":1130
18000  *
18001  * for i in range(ndim):
18002  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18003  * f_stride = mslice.strides[i]
18004  * break
18005  */
18006  __Pyx_TraceLine(1130,1,__PYX_ERR(1, 1130, __pyx_L1_error))
18007  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18008  if (__pyx_t_2) {
18009 
18010  /* "View.MemoryView":1131
18011  * for i in range(ndim):
18012  * if mslice.shape[i] > 1:
18013  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18014  * break
18015  *
18016  */
18017  __Pyx_TraceLine(1131,1,__PYX_ERR(1, 1131, __pyx_L1_error))
18018  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18019 
18020  /* "View.MemoryView":1132
18021  * if mslice.shape[i] > 1:
18022  * f_stride = mslice.strides[i]
18023  * break # <<<<<<<<<<<<<<
18024  *
18025  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18026  */
18027  __Pyx_TraceLine(1132,1,__PYX_ERR(1, 1132, __pyx_L1_error))
18028  goto __pyx_L7_break;
18029 
18030  /* "View.MemoryView":1130
18031  *
18032  * for i in range(ndim):
18033  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18034  * f_stride = mslice.strides[i]
18035  * break
18036  */
18037  }
18038  }
18039  __pyx_L7_break:;
18040 
18041  /* "View.MemoryView":1134
18042  * break
18043  *
18044  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18045  * return 'C'
18046  * else:
18047  */
18048  __Pyx_TraceLine(1134,1,__PYX_ERR(1, 1134, __pyx_L1_error))
18049  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18050  if (__pyx_t_2) {
18051 
18052  /* "View.MemoryView":1135
18053  *
18054  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18055  * return 'C' # <<<<<<<<<<<<<<
18056  * else:
18057  * return 'F'
18058  */
18059  __Pyx_TraceLine(1135,1,__PYX_ERR(1, 1135, __pyx_L1_error))
18060  __pyx_r = 'C';
18061  goto __pyx_L0;
18062 
18063  /* "View.MemoryView":1134
18064  * break
18065  *
18066  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18067  * return 'C'
18068  * else:
18069  */
18070  }
18071 
18072  /* "View.MemoryView":1137
18073  * return 'C'
18074  * else:
18075  * return 'F' # <<<<<<<<<<<<<<
18076  *
18077  * @cython.cdivision(True)
18078  */
18079  __Pyx_TraceLine(1137,1,__PYX_ERR(1, 1137, __pyx_L1_error))
18080  /*else*/ {
18081  __pyx_r = 'F';
18082  goto __pyx_L0;
18083  }
18084 
18085  /* "View.MemoryView":1116
18086  *
18087  * @cname('__pyx_get_best_slice_order')
18088  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18089  * """
18090  * Figure out the best memory access order for a given slice.
18091  */
18092 
18093  /* function exit code */
18094  __pyx_L1_error:;
18095  __Pyx_WriteUnraisable("View.MemoryView.get_best_order", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18096  __pyx_r = 0;
18097  __pyx_L0:;
18098  __Pyx_TraceReturn(Py_None, 1);
18099  return __pyx_r;
18100 }
18101 
18102 /* "View.MemoryView":1140
18103  *
18104  * @cython.cdivision(True)
18105  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18106  * char *dst_data, Py_ssize_t *dst_strides,
18107  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18108  */
18109 
18110 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18111  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18112  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18113  Py_ssize_t __pyx_v_dst_extent;
18114  Py_ssize_t __pyx_v_src_stride;
18115  Py_ssize_t __pyx_v_dst_stride;
18116  int __pyx_t_1;
18117  int __pyx_t_2;
18118  int __pyx_t_3;
18119  Py_ssize_t __pyx_t_4;
18120  Py_ssize_t __pyx_t_5;
18121  Py_ssize_t __pyx_t_6;
18122 
18123  /* "View.MemoryView":1147
18124  *
18125  * cdef Py_ssize_t i
18126  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18127  * cdef Py_ssize_t dst_extent = dst_shape[0]
18128  * cdef Py_ssize_t src_stride = src_strides[0]
18129  */
18130  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18131 
18132  /* "View.MemoryView":1148
18133  * cdef Py_ssize_t i
18134  * cdef Py_ssize_t src_extent = src_shape[0]
18135  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18136  * cdef Py_ssize_t src_stride = src_strides[0]
18137  * cdef Py_ssize_t dst_stride = dst_strides[0]
18138  */
18139  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18140 
18141  /* "View.MemoryView":1149
18142  * cdef Py_ssize_t src_extent = src_shape[0]
18143  * cdef Py_ssize_t dst_extent = dst_shape[0]
18144  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18145  * cdef Py_ssize_t dst_stride = dst_strides[0]
18146  *
18147  */
18148  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18149 
18150  /* "View.MemoryView":1150
18151  * cdef Py_ssize_t dst_extent = dst_shape[0]
18152  * cdef Py_ssize_t src_stride = src_strides[0]
18153  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18154  *
18155  * if ndim == 1:
18156  */
18157  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18158 
18159  /* "View.MemoryView":1152
18160  * cdef Py_ssize_t dst_stride = dst_strides[0]
18161  *
18162  * if ndim == 1: # <<<<<<<<<<<<<<
18163  * if (src_stride > 0 and dst_stride > 0 and
18164  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18165  */
18166  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18167  if (__pyx_t_1) {
18168 
18169  /* "View.MemoryView":1153
18170  *
18171  * if ndim == 1:
18172  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18173  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18174  * memcpy(dst_data, src_data, itemsize * dst_extent)
18175  */
18176  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18177  if (__pyx_t_2) {
18178  } else {
18179  __pyx_t_1 = __pyx_t_2;
18180  goto __pyx_L5_bool_binop_done;
18181  }
18182  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18183  if (__pyx_t_2) {
18184  } else {
18185  __pyx_t_1 = __pyx_t_2;
18186  goto __pyx_L5_bool_binop_done;
18187  }
18188 
18189  /* "View.MemoryView":1154
18190  * if ndim == 1:
18191  * if (src_stride > 0 and dst_stride > 0 and
18192  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18193  * memcpy(dst_data, src_data, itemsize * dst_extent)
18194  * else:
18195  */
18196  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18197  if (__pyx_t_2) {
18198  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18199  }
18200  __pyx_t_3 = (__pyx_t_2 != 0);
18201  __pyx_t_1 = __pyx_t_3;
18202  __pyx_L5_bool_binop_done:;
18203 
18204  /* "View.MemoryView":1153
18205  *
18206  * if ndim == 1:
18207  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18208  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18209  * memcpy(dst_data, src_data, itemsize * dst_extent)
18210  */
18211  if (__pyx_t_1) {
18212 
18213  /* "View.MemoryView":1155
18214  * if (src_stride > 0 and dst_stride > 0 and
18215  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18216  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18217  * else:
18218  * for i in range(dst_extent):
18219  */
18220  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18221 
18222  /* "View.MemoryView":1153
18223  *
18224  * if ndim == 1:
18225  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18226  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18227  * memcpy(dst_data, src_data, itemsize * dst_extent)
18228  */
18229  goto __pyx_L4;
18230  }
18231 
18232  /* "View.MemoryView":1157
18233  * memcpy(dst_data, src_data, itemsize * dst_extent)
18234  * else:
18235  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18236  * memcpy(dst_data, src_data, itemsize)
18237  * src_data += src_stride
18238  */
18239  /*else*/ {
18240  __pyx_t_4 = __pyx_v_dst_extent;
18241  __pyx_t_5 = __pyx_t_4;
18242  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18243  __pyx_v_i = __pyx_t_6;
18244 
18245  /* "View.MemoryView":1158
18246  * else:
18247  * for i in range(dst_extent):
18248  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18249  * src_data += src_stride
18250  * dst_data += dst_stride
18251  */
18252  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18253 
18254  /* "View.MemoryView":1159
18255  * for i in range(dst_extent):
18256  * memcpy(dst_data, src_data, itemsize)
18257  * src_data += src_stride # <<<<<<<<<<<<<<
18258  * dst_data += dst_stride
18259  * else:
18260  */
18261  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18262 
18263  /* "View.MemoryView":1160
18264  * memcpy(dst_data, src_data, itemsize)
18265  * src_data += src_stride
18266  * dst_data += dst_stride # <<<<<<<<<<<<<<
18267  * else:
18268  * for i in range(dst_extent):
18269  */
18270  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18271  }
18272  }
18273  __pyx_L4:;
18274 
18275  /* "View.MemoryView":1152
18276  * cdef Py_ssize_t dst_stride = dst_strides[0]
18277  *
18278  * if ndim == 1: # <<<<<<<<<<<<<<
18279  * if (src_stride > 0 and dst_stride > 0 and
18280  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18281  */
18282  goto __pyx_L3;
18283  }
18284 
18285  /* "View.MemoryView":1162
18286  * dst_data += dst_stride
18287  * else:
18288  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18289  * _copy_strided_to_strided(src_data, src_strides + 1,
18290  * dst_data, dst_strides + 1,
18291  */
18292  /*else*/ {
18293  __pyx_t_4 = __pyx_v_dst_extent;
18294  __pyx_t_5 = __pyx_t_4;
18295  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18296  __pyx_v_i = __pyx_t_6;
18297 
18298  /* "View.MemoryView":1163
18299  * else:
18300  * for i in range(dst_extent):
18301  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18302  * dst_data, dst_strides + 1,
18303  * src_shape + 1, dst_shape + 1,
18304  */
18305  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18306 
18307  /* "View.MemoryView":1167
18308  * src_shape + 1, dst_shape + 1,
18309  * ndim - 1, itemsize)
18310  * src_data += src_stride # <<<<<<<<<<<<<<
18311  * dst_data += dst_stride
18312  *
18313  */
18314  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18315 
18316  /* "View.MemoryView":1168
18317  * ndim - 1, itemsize)
18318  * src_data += src_stride
18319  * dst_data += dst_stride # <<<<<<<<<<<<<<
18320  *
18321  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18322  */
18323  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18324  }
18325  }
18326  __pyx_L3:;
18327 
18328  /* "View.MemoryView":1140
18329  *
18330  * @cython.cdivision(True)
18331  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18332  * char *dst_data, Py_ssize_t *dst_strides,
18333  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18334  */
18335 
18336  /* function exit code */
18337 }
18338 
18339 /* "View.MemoryView":1170
18340  * dst_data += dst_stride
18341  *
18342  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18343  * __Pyx_memviewslice *dst,
18344  * int ndim, size_t itemsize) nogil:
18345  */
18346 
18347 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18348  __Pyx_TraceDeclarations
18349  int __pyx_lineno = 0;
18350  const char *__pyx_filename = NULL;
18351  int __pyx_clineno = 0;
18352  __Pyx_TraceCall("copy_strided_to_strided", __pyx_f[1], 1170, 1, __PYX_ERR(1, 1170, __pyx_L1_error));
18353 
18354  /* "View.MemoryView":1173
18355  * __Pyx_memviewslice *dst,
18356  * int ndim, size_t itemsize) nogil:
18357  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18358  * src.shape, dst.shape, ndim, itemsize)
18359  *
18360  */
18361  __Pyx_TraceLine(1173,1,__PYX_ERR(1, 1173, __pyx_L1_error))
18362  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18363 
18364  /* "View.MemoryView":1170
18365  * dst_data += dst_stride
18366  *
18367  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18368  * __Pyx_memviewslice *dst,
18369  * int ndim, size_t itemsize) nogil:
18370  */
18371 
18372  /* function exit code */
18373  goto __pyx_L0;
18374  __pyx_L1_error:;
18375  __Pyx_WriteUnraisable("View.MemoryView.copy_strided_to_strided", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18376  __pyx_L0:;
18377  __Pyx_TraceReturn(Py_None, 1);
18378 }
18379 
18380 /* "View.MemoryView":1177
18381  *
18382  * @cname('__pyx_memoryview_slice_get_size')
18383  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18384  * "Return the size of the memory occupied by the slice in number of bytes"
18385  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18386  */
18387 
18388 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18389  Py_ssize_t __pyx_v_shape;
18390  Py_ssize_t __pyx_v_size;
18391  Py_ssize_t __pyx_r;
18392  __Pyx_TraceDeclarations
18393  Py_ssize_t __pyx_t_1;
18394  Py_ssize_t *__pyx_t_2;
18395  Py_ssize_t *__pyx_t_3;
18396  Py_ssize_t *__pyx_t_4;
18397  int __pyx_lineno = 0;
18398  const char *__pyx_filename = NULL;
18399  int __pyx_clineno = 0;
18400  __Pyx_TraceCall("slice_get_size", __pyx_f[1], 1177, 1, __PYX_ERR(1, 1177, __pyx_L1_error));
18401 
18402  /* "View.MemoryView":1179
18403  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil:
18404  * "Return the size of the memory occupied by the slice in number of bytes"
18405  * cdef Py_ssize_t shape, size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18406  *
18407  * for shape in src.shape[:ndim]:
18408  */
18409  __Pyx_TraceLine(1179,1,__PYX_ERR(1, 1179, __pyx_L1_error))
18410  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18411  __pyx_v_size = __pyx_t_1;
18412 
18413  /* "View.MemoryView":1181
18414  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18415  *
18416  * for shape in src.shape[:ndim]: # <<<<<<<<<<<<<<
18417  * size *= shape
18418  *
18419  */
18420  __Pyx_TraceLine(1181,1,__PYX_ERR(1, 1181, __pyx_L1_error))
18421  __pyx_t_3 = (__pyx_v_src->shape + __pyx_v_ndim);
18422  for (__pyx_t_4 = __pyx_v_src->shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
18423  __pyx_t_2 = __pyx_t_4;
18424  __pyx_v_shape = (__pyx_t_2[0]);
18425 
18426  /* "View.MemoryView":1182
18427  *
18428  * for shape in src.shape[:ndim]:
18429  * size *= shape # <<<<<<<<<<<<<<
18430  *
18431  * return size
18432  */
18433  __Pyx_TraceLine(1182,1,__PYX_ERR(1, 1182, __pyx_L1_error))
18434  __pyx_v_size = (__pyx_v_size * __pyx_v_shape);
18435  }
18436 
18437  /* "View.MemoryView":1184
18438  * size *= shape
18439  *
18440  * return size # <<<<<<<<<<<<<<
18441  *
18442  * @cname('__pyx_fill_contig_strides_array')
18443  */
18444  __Pyx_TraceLine(1184,1,__PYX_ERR(1, 1184, __pyx_L1_error))
18445  __pyx_r = __pyx_v_size;
18446  goto __pyx_L0;
18447 
18448  /* "View.MemoryView":1177
18449  *
18450  * @cname('__pyx_memoryview_slice_get_size')
18451  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18452  * "Return the size of the memory occupied by the slice in number of bytes"
18453  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
18454  */
18455 
18456  /* function exit code */
18457  __pyx_L1_error:;
18458  __Pyx_WriteUnraisable("View.MemoryView.slice_get_size", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18459  __pyx_r = 0;
18460  __pyx_L0:;
18461  __Pyx_TraceReturn(Py_None, 1);
18462  return __pyx_r;
18463 }
18464 
18465 /* "View.MemoryView":1187
18466  *
18467  * @cname('__pyx_fill_contig_strides_array')
18468  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18469  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18470  * int ndim, char order) nogil:
18471  */
18472 
18473 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18474  int __pyx_v_idx;
18475  Py_ssize_t __pyx_r;
18476  __Pyx_TraceDeclarations
18477  int __pyx_t_1;
18478  int __pyx_t_2;
18479  int __pyx_t_3;
18480  int __pyx_t_4;
18481  int __pyx_lineno = 0;
18482  const char *__pyx_filename = NULL;
18483  int __pyx_clineno = 0;
18484  __Pyx_TraceCall("fill_contig_strides_array", __pyx_f[1], 1187, 1, __PYX_ERR(1, 1187, __pyx_L1_error));
18485 
18486  /* "View.MemoryView":1196
18487  * cdef int idx
18488  *
18489  * if order == 'F': # <<<<<<<<<<<<<<
18490  * for idx in range(ndim):
18491  * strides[idx] = stride
18492  */
18493  __Pyx_TraceLine(1196,1,__PYX_ERR(1, 1196, __pyx_L1_error))
18494  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18495  if (__pyx_t_1) {
18496 
18497  /* "View.MemoryView":1197
18498  *
18499  * if order == 'F':
18500  * for idx in range(ndim): # <<<<<<<<<<<<<<
18501  * strides[idx] = stride
18502  * stride *= shape[idx]
18503  */
18504  __Pyx_TraceLine(1197,1,__PYX_ERR(1, 1197, __pyx_L1_error))
18505  __pyx_t_2 = __pyx_v_ndim;
18506  __pyx_t_3 = __pyx_t_2;
18507  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18508  __pyx_v_idx = __pyx_t_4;
18509 
18510  /* "View.MemoryView":1198
18511  * if order == 'F':
18512  * for idx in range(ndim):
18513  * strides[idx] = stride # <<<<<<<<<<<<<<
18514  * stride *= shape[idx]
18515  * else:
18516  */
18517  __Pyx_TraceLine(1198,1,__PYX_ERR(1, 1198, __pyx_L1_error))
18518  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18519 
18520  /* "View.MemoryView":1199
18521  * for idx in range(ndim):
18522  * strides[idx] = stride
18523  * stride *= shape[idx] # <<<<<<<<<<<<<<
18524  * else:
18525  * for idx in range(ndim - 1, -1, -1):
18526  */
18527  __Pyx_TraceLine(1199,1,__PYX_ERR(1, 1199, __pyx_L1_error))
18528  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18529  }
18530 
18531  /* "View.MemoryView":1196
18532  * cdef int idx
18533  *
18534  * if order == 'F': # <<<<<<<<<<<<<<
18535  * for idx in range(ndim):
18536  * strides[idx] = stride
18537  */
18538  goto __pyx_L3;
18539  }
18540 
18541  /* "View.MemoryView":1201
18542  * stride *= shape[idx]
18543  * else:
18544  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18545  * strides[idx] = stride
18546  * stride *= shape[idx]
18547  */
18548  __Pyx_TraceLine(1201,1,__PYX_ERR(1, 1201, __pyx_L1_error))
18549  /*else*/ {
18550  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18551  __pyx_v_idx = __pyx_t_2;
18552 
18553  /* "View.MemoryView":1202
18554  * else:
18555  * for idx in range(ndim - 1, -1, -1):
18556  * strides[idx] = stride # <<<<<<<<<<<<<<
18557  * stride *= shape[idx]
18558  *
18559  */
18560  __Pyx_TraceLine(1202,1,__PYX_ERR(1, 1202, __pyx_L1_error))
18561  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18562 
18563  /* "View.MemoryView":1203
18564  * for idx in range(ndim - 1, -1, -1):
18565  * strides[idx] = stride
18566  * stride *= shape[idx] # <<<<<<<<<<<<<<
18567  *
18568  * return stride
18569  */
18570  __Pyx_TraceLine(1203,1,__PYX_ERR(1, 1203, __pyx_L1_error))
18571  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18572  }
18573  }
18574  __pyx_L3:;
18575 
18576  /* "View.MemoryView":1205
18577  * stride *= shape[idx]
18578  *
18579  * return stride # <<<<<<<<<<<<<<
18580  *
18581  * @cname('__pyx_memoryview_copy_data_to_temp')
18582  */
18583  __Pyx_TraceLine(1205,1,__PYX_ERR(1, 1205, __pyx_L1_error))
18584  __pyx_r = __pyx_v_stride;
18585  goto __pyx_L0;
18586 
18587  /* "View.MemoryView":1187
18588  *
18589  * @cname('__pyx_fill_contig_strides_array')
18590  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18591  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18592  * int ndim, char order) nogil:
18593  */
18594 
18595  /* function exit code */
18596  __pyx_L1_error:;
18597  __Pyx_WriteUnraisable("View.MemoryView.fill_contig_strides_array", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
18598  __pyx_r = 0;
18599  __pyx_L0:;
18600  __Pyx_TraceReturn(Py_None, 1);
18601  return __pyx_r;
18602 }
18603 
18604 /* "View.MemoryView":1208
18605  *
18606  * @cname('__pyx_memoryview_copy_data_to_temp')
18607  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18608  * __Pyx_memviewslice *tmpslice,
18609  * char order,
18610  */
18611 
18612 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18613  int __pyx_v_i;
18614  void *__pyx_v_result;
18615  size_t __pyx_v_itemsize;
18616  size_t __pyx_v_size;
18617  void *__pyx_r;
18618  __Pyx_TraceDeclarations
18619  Py_ssize_t __pyx_t_1;
18620  int __pyx_t_2;
18621  int __pyx_t_3;
18622  struct __pyx_memoryview_obj *__pyx_t_4;
18623  int __pyx_t_5;
18624  int __pyx_t_6;
18625  int __pyx_lineno = 0;
18626  const char *__pyx_filename = NULL;
18627  int __pyx_clineno = 0;
18628  __Pyx_TraceCall("copy_data_to_temp", __pyx_f[1], 1208, 1, __PYX_ERR(1, 1208, __pyx_L1_error));
18629 
18630  /* "View.MemoryView":1219
18631  * cdef void *result
18632  *
18633  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18634  * cdef size_t size = slice_get_size(src, ndim)
18635  *
18636  */
18637  __Pyx_TraceLine(1219,1,__PYX_ERR(1, 1219, __pyx_L1_error))
18638  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18639  __pyx_v_itemsize = __pyx_t_1;
18640 
18641  /* "View.MemoryView":1220
18642  *
18643  * cdef size_t itemsize = src.memview.view.itemsize
18644  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18645  *
18646  * result = malloc(size)
18647  */
18648  __Pyx_TraceLine(1220,1,__PYX_ERR(1, 1220, __pyx_L1_error))
18649  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18650 
18651  /* "View.MemoryView":1222
18652  * cdef size_t size = slice_get_size(src, ndim)
18653  *
18654  * result = malloc(size) # <<<<<<<<<<<<<<
18655  * if not result:
18656  * _err(MemoryError, NULL)
18657  */
18658  __Pyx_TraceLine(1222,1,__PYX_ERR(1, 1222, __pyx_L1_error))
18659  __pyx_v_result = malloc(__pyx_v_size);
18660 
18661  /* "View.MemoryView":1223
18662  *
18663  * result = malloc(size)
18664  * if not result: # <<<<<<<<<<<<<<
18665  * _err(MemoryError, NULL)
18666  *
18667  */
18668  __Pyx_TraceLine(1223,1,__PYX_ERR(1, 1223, __pyx_L1_error))
18669  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18670  if (__pyx_t_2) {
18671 
18672  /* "View.MemoryView":1224
18673  * result = malloc(size)
18674  * if not result:
18675  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18676  *
18677  *
18678  */
18679  __Pyx_TraceLine(1224,1,__PYX_ERR(1, 1224, __pyx_L1_error))
18680  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(1, 1224, __pyx_L1_error)
18681 
18682  /* "View.MemoryView":1223
18683  *
18684  * result = malloc(size)
18685  * if not result: # <<<<<<<<<<<<<<
18686  * _err(MemoryError, NULL)
18687  *
18688  */
18689  }
18690 
18691  /* "View.MemoryView":1227
18692  *
18693  *
18694  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18695  * tmpslice.memview = src.memview
18696  * for i in range(ndim):
18697  */
18698  __Pyx_TraceLine(1227,1,__PYX_ERR(1, 1227, __pyx_L1_error))
18699  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18700 
18701  /* "View.MemoryView":1228
18702  *
18703  * tmpslice.data = <char *> result
18704  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18705  * for i in range(ndim):
18706  * tmpslice.shape[i] = src.shape[i]
18707  */
18708  __Pyx_TraceLine(1228,1,__PYX_ERR(1, 1228, __pyx_L1_error))
18709  __pyx_t_4 = __pyx_v_src->memview;
18710  __pyx_v_tmpslice->memview = __pyx_t_4;
18711 
18712  /* "View.MemoryView":1229
18713  * tmpslice.data = <char *> result
18714  * tmpslice.memview = src.memview
18715  * for i in range(ndim): # <<<<<<<<<<<<<<
18716  * tmpslice.shape[i] = src.shape[i]
18717  * tmpslice.suboffsets[i] = -1
18718  */
18719  __Pyx_TraceLine(1229,1,__PYX_ERR(1, 1229, __pyx_L1_error))
18720  __pyx_t_3 = __pyx_v_ndim;
18721  __pyx_t_5 = __pyx_t_3;
18722  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18723  __pyx_v_i = __pyx_t_6;
18724 
18725  /* "View.MemoryView":1230
18726  * tmpslice.memview = src.memview
18727  * for i in range(ndim):
18728  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18729  * tmpslice.suboffsets[i] = -1
18730  *
18731  */
18732  __Pyx_TraceLine(1230,1,__PYX_ERR(1, 1230, __pyx_L1_error))
18733  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18734 
18735  /* "View.MemoryView":1231
18736  * for i in range(ndim):
18737  * tmpslice.shape[i] = src.shape[i]
18738  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18739  *
18740  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18741  */
18742  __Pyx_TraceLine(1231,1,__PYX_ERR(1, 1231, __pyx_L1_error))
18743  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18744  }
18745 
18746  /* "View.MemoryView":1233
18747  * tmpslice.suboffsets[i] = -1
18748  *
18749  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18750  * ndim, order)
18751  *
18752  */
18753  __Pyx_TraceLine(1233,1,__PYX_ERR(1, 1233, __pyx_L1_error))
18754  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18755 
18756  /* "View.MemoryView":1237
18757  *
18758  *
18759  * for i in range(ndim): # <<<<<<<<<<<<<<
18760  * if tmpslice.shape[i] == 1:
18761  * tmpslice.strides[i] = 0
18762  */
18763  __Pyx_TraceLine(1237,1,__PYX_ERR(1, 1237, __pyx_L1_error))
18764  __pyx_t_3 = __pyx_v_ndim;
18765  __pyx_t_5 = __pyx_t_3;
18766  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18767  __pyx_v_i = __pyx_t_6;
18768 
18769  /* "View.MemoryView":1238
18770  *
18771  * for i in range(ndim):
18772  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18773  * tmpslice.strides[i] = 0
18774  *
18775  */
18776  __Pyx_TraceLine(1238,1,__PYX_ERR(1, 1238, __pyx_L1_error))
18777  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18778  if (__pyx_t_2) {
18779 
18780  /* "View.MemoryView":1239
18781  * for i in range(ndim):
18782  * if tmpslice.shape[i] == 1:
18783  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18784  *
18785  * if slice_is_contig(src[0], order, ndim):
18786  */
18787  __Pyx_TraceLine(1239,1,__PYX_ERR(1, 1239, __pyx_L1_error))
18788  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18789 
18790  /* "View.MemoryView":1238
18791  *
18792  * for i in range(ndim):
18793  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18794  * tmpslice.strides[i] = 0
18795  *
18796  */
18797  }
18798  }
18799 
18800  /* "View.MemoryView":1241
18801  * tmpslice.strides[i] = 0
18802  *
18803  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18804  * memcpy(result, src.data, size)
18805  * else:
18806  */
18807  __Pyx_TraceLine(1241,1,__PYX_ERR(1, 1241, __pyx_L1_error))
18808  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18809  if (__pyx_t_2) {
18810 
18811  /* "View.MemoryView":1242
18812  *
18813  * if slice_is_contig(src[0], order, ndim):
18814  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18815  * else:
18816  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18817  */
18818  __Pyx_TraceLine(1242,1,__PYX_ERR(1, 1242, __pyx_L1_error))
18819  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18820 
18821  /* "View.MemoryView":1241
18822  * tmpslice.strides[i] = 0
18823  *
18824  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18825  * memcpy(result, src.data, size)
18826  * else:
18827  */
18828  goto __pyx_L9;
18829  }
18830 
18831  /* "View.MemoryView":1244
18832  * memcpy(result, src.data, size)
18833  * else:
18834  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18835  *
18836  * return result
18837  */
18838  __Pyx_TraceLine(1244,1,__PYX_ERR(1, 1244, __pyx_L1_error))
18839  /*else*/ {
18840  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18841  }
18842  __pyx_L9:;
18843 
18844  /* "View.MemoryView":1246
18845  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18846  *
18847  * return result # <<<<<<<<<<<<<<
18848  *
18849  *
18850  */
18851  __Pyx_TraceLine(1246,1,__PYX_ERR(1, 1246, __pyx_L1_error))
18852  __pyx_r = __pyx_v_result;
18853  goto __pyx_L0;
18854 
18855  /* "View.MemoryView":1208
18856  *
18857  * @cname('__pyx_memoryview_copy_data_to_temp')
18858  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18859  * __Pyx_memviewslice *tmpslice,
18860  * char order,
18861  */
18862 
18863  /* function exit code */
18864  __pyx_L1_error:;
18865  {
18866  #ifdef WITH_THREAD
18867  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18868  #endif
18869  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18870  #ifdef WITH_THREAD
18871  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18872  #endif
18873  }
18874  __pyx_r = NULL;
18875  __pyx_L0:;
18876  __Pyx_TraceReturn(Py_None, 1);
18877  return __pyx_r;
18878 }
18879 
18880 /* "View.MemoryView":1251
18881  *
18882  * @cname('__pyx_memoryview_err_extents')
18883  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18884  * Py_ssize_t extent2) except -1 with gil:
18885  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18886  */
18887 
18888 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18889  int __pyx_r;
18890  __Pyx_TraceDeclarations
18891  __Pyx_RefNannyDeclarations
18892  PyObject *__pyx_t_1 = NULL;
18893  PyObject *__pyx_t_2 = NULL;
18894  PyObject *__pyx_t_3 = NULL;
18895  PyObject *__pyx_t_4 = NULL;
18896  int __pyx_lineno = 0;
18897  const char *__pyx_filename = NULL;
18898  int __pyx_clineno = 0;
18899  #ifdef WITH_THREAD
18900  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18901  #endif
18902  __Pyx_RefNannySetupContext("_err_extents", 0);
18903  __Pyx_TraceCall("_err_extents", __pyx_f[1], 1251, 0, __PYX_ERR(1, 1251, __pyx_L1_error));
18904 
18905  /* "View.MemoryView":1254
18906  * Py_ssize_t extent2) except -1 with gil:
18907  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18908  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18909  *
18910  * @cname('__pyx_memoryview_err_dim')
18911  */
18912  __Pyx_TraceLine(1254,0,__PYX_ERR(1, 1254, __pyx_L1_error))
18913  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1254, __pyx_L1_error)
18914  __Pyx_GOTREF(__pyx_t_1);
18915  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1254, __pyx_L1_error)
18916  __Pyx_GOTREF(__pyx_t_2);
18917  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1254, __pyx_L1_error)
18918  __Pyx_GOTREF(__pyx_t_3);
18919  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1254, __pyx_L1_error)
18920  __Pyx_GOTREF(__pyx_t_4);
18921  __Pyx_GIVEREF(__pyx_t_1);
18922  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18923  __Pyx_GIVEREF(__pyx_t_2);
18924  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18925  __Pyx_GIVEREF(__pyx_t_3);
18926  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18927  __pyx_t_1 = 0;
18928  __pyx_t_2 = 0;
18929  __pyx_t_3 = 0;
18930 
18931  /* "View.MemoryView":1253
18932  * cdef int _err_extents(int i, Py_ssize_t extent1,
18933  * Py_ssize_t extent2) except -1 with gil:
18934  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18935  * (i, extent1, extent2))
18936  *
18937  */
18938  __Pyx_TraceLine(1253,0,__PYX_ERR(1, 1253, __pyx_L1_error))
18939  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1253, __pyx_L1_error)
18940  __Pyx_GOTREF(__pyx_t_3);
18941  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18942  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1253, __pyx_L1_error)
18943  __Pyx_GOTREF(__pyx_t_4);
18944  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18945  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18946  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18947  __PYX_ERR(1, 1253, __pyx_L1_error)
18948 
18949  /* "View.MemoryView":1251
18950  *
18951  * @cname('__pyx_memoryview_err_extents')
18952  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18953  * Py_ssize_t extent2) except -1 with gil:
18954  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18955  */
18956 
18957  /* function exit code */
18958  __pyx_L1_error:;
18959  __Pyx_XDECREF(__pyx_t_1);
18960  __Pyx_XDECREF(__pyx_t_2);
18961  __Pyx_XDECREF(__pyx_t_3);
18962  __Pyx_XDECREF(__pyx_t_4);
18963  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18964  __pyx_r = -1;
18965  __Pyx_TraceReturn(Py_None, 0);
18966  __Pyx_RefNannyFinishContext();
18967  #ifdef WITH_THREAD
18968  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18969  #endif
18970  return __pyx_r;
18971 }
18972 
18973 /* "View.MemoryView":1257
18974  *
18975  * @cname('__pyx_memoryview_err_dim')
18976  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18977  * raise error(msg.decode('ascii') % dim)
18978  *
18979  */
18980 
18981 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18982  int __pyx_r;
18983  __Pyx_TraceDeclarations
18984  __Pyx_RefNannyDeclarations
18985  PyObject *__pyx_t_1 = NULL;
18986  PyObject *__pyx_t_2 = NULL;
18987  PyObject *__pyx_t_3 = NULL;
18988  PyObject *__pyx_t_4 = NULL;
18989  int __pyx_lineno = 0;
18990  const char *__pyx_filename = NULL;
18991  int __pyx_clineno = 0;
18992  #ifdef WITH_THREAD
18993  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18994  #endif
18995  __Pyx_RefNannySetupContext("_err_dim", 0);
18996  __Pyx_TraceCall("_err_dim", __pyx_f[1], 1257, 0, __PYX_ERR(1, 1257, __pyx_L1_error));
18997  __Pyx_INCREF(__pyx_v_error);
18998 
18999  /* "View.MemoryView":1258
19000  * @cname('__pyx_memoryview_err_dim')
19001  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
19002  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
19003  *
19004  * @cname('__pyx_memoryview_err')
19005  */
19006  __Pyx_TraceLine(1258,0,__PYX_ERR(1, 1258, __pyx_L1_error))
19007  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1258, __pyx_L1_error)
19008  __Pyx_GOTREF(__pyx_t_2);
19009  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1258, __pyx_L1_error)
19010  __Pyx_GOTREF(__pyx_t_3);
19011  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 1258, __pyx_L1_error)
19012  __Pyx_GOTREF(__pyx_t_4);
19013  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19014  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19015  __Pyx_INCREF(__pyx_v_error);
19016  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
19017  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
19018  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19019  if (likely(__pyx_t_2)) {
19020  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19021  __Pyx_INCREF(__pyx_t_2);
19022  __Pyx_INCREF(function);
19023  __Pyx_DECREF_SET(__pyx_t_3, function);
19024  }
19025  }
19026  __pyx_t_1 = (__pyx_t_2) ? __Pyx_PyObject_Call2Args(__pyx_t_3, __pyx_t_2, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4);
19027  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19028  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19029  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1258, __pyx_L1_error)
19030  __Pyx_GOTREF(__pyx_t_1);
19031  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19032  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19033  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19034  __PYX_ERR(1, 1258, __pyx_L1_error)
19035 
19036  /* "View.MemoryView":1257
19037  *
19038  * @cname('__pyx_memoryview_err_dim')
19039  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19040  * raise error(msg.decode('ascii') % dim)
19041  *
19042  */
19043 
19044  /* function exit code */
19045  __pyx_L1_error:;
19046  __Pyx_XDECREF(__pyx_t_1);
19047  __Pyx_XDECREF(__pyx_t_2);
19048  __Pyx_XDECREF(__pyx_t_3);
19049  __Pyx_XDECREF(__pyx_t_4);
19050  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19051  __pyx_r = -1;
19052  __Pyx_XDECREF(__pyx_v_error);
19053  __Pyx_TraceReturn(Py_None, 0);
19054  __Pyx_RefNannyFinishContext();
19055  #ifdef WITH_THREAD
19056  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19057  #endif
19058  return __pyx_r;
19059 }
19060 
19061 /* "View.MemoryView":1261
19062  *
19063  * @cname('__pyx_memoryview_err')
19064  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19065  * if msg != NULL:
19066  * raise error(msg.decode('ascii'))
19067  */
19068 
19069 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19070  int __pyx_r;
19071  __Pyx_TraceDeclarations
19072  __Pyx_RefNannyDeclarations
19073  int __pyx_t_1;
19074  PyObject *__pyx_t_2 = NULL;
19075  PyObject *__pyx_t_3 = NULL;
19076  PyObject *__pyx_t_4 = NULL;
19077  PyObject *__pyx_t_5 = NULL;
19078  int __pyx_lineno = 0;
19079  const char *__pyx_filename = NULL;
19080  int __pyx_clineno = 0;
19081  #ifdef WITH_THREAD
19082  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19083  #endif
19084  __Pyx_RefNannySetupContext("_err", 0);
19085  __Pyx_TraceCall("_err", __pyx_f[1], 1261, 0, __PYX_ERR(1, 1261, __pyx_L1_error));
19086  __Pyx_INCREF(__pyx_v_error);
19087 
19088  /* "View.MemoryView":1262
19089  * @cname('__pyx_memoryview_err')
19090  * cdef int _err(object error, char *msg) except -1 with gil:
19091  * if msg != NULL: # <<<<<<<<<<<<<<
19092  * raise error(msg.decode('ascii'))
19093  * else:
19094  */
19095  __Pyx_TraceLine(1262,0,__PYX_ERR(1, 1262, __pyx_L1_error))
19096  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19097  if (unlikely(__pyx_t_1)) {
19098 
19099  /* "View.MemoryView":1263
19100  * cdef int _err(object error, char *msg) except -1 with gil:
19101  * if msg != NULL:
19102  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19103  * else:
19104  * raise error
19105  */
19106  __Pyx_TraceLine(1263,0,__PYX_ERR(1, 1263, __pyx_L1_error))
19107  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 1263, __pyx_L1_error)
19108  __Pyx_GOTREF(__pyx_t_3);
19109  __Pyx_INCREF(__pyx_v_error);
19110  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19111  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19112  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19113  if (likely(__pyx_t_5)) {
19114  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19115  __Pyx_INCREF(__pyx_t_5);
19116  __Pyx_INCREF(function);
19117  __Pyx_DECREF_SET(__pyx_t_4, function);
19118  }
19119  }
19120  __pyx_t_2 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_4, __pyx_t_5, __pyx_t_3) : __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3);
19121  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19122  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19123  if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1263, __pyx_L1_error)
19124  __Pyx_GOTREF(__pyx_t_2);
19125  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19126  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19127  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19128  __PYX_ERR(1, 1263, __pyx_L1_error)
19129 
19130  /* "View.MemoryView":1262
19131  * @cname('__pyx_memoryview_err')
19132  * cdef int _err(object error, char *msg) except -1 with gil:
19133  * if msg != NULL: # <<<<<<<<<<<<<<
19134  * raise error(msg.decode('ascii'))
19135  * else:
19136  */
19137  }
19138 
19139  /* "View.MemoryView":1265
19140  * raise error(msg.decode('ascii'))
19141  * else:
19142  * raise error # <<<<<<<<<<<<<<
19143  *
19144  * @cname('__pyx_memoryview_copy_contents')
19145  */
19146  __Pyx_TraceLine(1265,0,__PYX_ERR(1, 1265, __pyx_L1_error))
19147  /*else*/ {
19148  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19149  __PYX_ERR(1, 1265, __pyx_L1_error)
19150  }
19151 
19152  /* "View.MemoryView":1261
19153  *
19154  * @cname('__pyx_memoryview_err')
19155  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19156  * if msg != NULL:
19157  * raise error(msg.decode('ascii'))
19158  */
19159 
19160  /* function exit code */
19161  __pyx_L1_error:;
19162  __Pyx_XDECREF(__pyx_t_2);
19163  __Pyx_XDECREF(__pyx_t_3);
19164  __Pyx_XDECREF(__pyx_t_4);
19165  __Pyx_XDECREF(__pyx_t_5);
19166  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19167  __pyx_r = -1;
19168  __Pyx_XDECREF(__pyx_v_error);
19169  __Pyx_TraceReturn(Py_None, 0);
19170  __Pyx_RefNannyFinishContext();
19171  #ifdef WITH_THREAD
19172  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19173  #endif
19174  return __pyx_r;
19175 }
19176 
19177 /* "View.MemoryView":1268
19178  *
19179  * @cname('__pyx_memoryview_copy_contents')
19180  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19181  * __Pyx_memviewslice dst,
19182  * int src_ndim, int dst_ndim,
19183  */
19184 
19185 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19186  void *__pyx_v_tmpdata;
19187  size_t __pyx_v_itemsize;
19188  int __pyx_v_i;
19189  char __pyx_v_order;
19190  int __pyx_v_broadcasting;
19191  int __pyx_v_direct_copy;
19192  __Pyx_memviewslice __pyx_v_tmp;
19193  int __pyx_v_ndim;
19194  int __pyx_r;
19195  __Pyx_TraceDeclarations
19196  Py_ssize_t __pyx_t_1;
19197  int __pyx_t_2;
19198  int __pyx_t_3;
19199  int __pyx_t_4;
19200  int __pyx_t_5;
19201  int __pyx_t_6;
19202  void *__pyx_t_7;
19203  int __pyx_t_8;
19204  int __pyx_lineno = 0;
19205  const char *__pyx_filename = NULL;
19206  int __pyx_clineno = 0;
19207  __Pyx_TraceCall("memoryview_copy_contents", __pyx_f[1], 1268, 1, __PYX_ERR(1, 1268, __pyx_L1_error));
19208 
19209  /* "View.MemoryView":1276
19210  * Check for overlapping memory and verify the shapes.
19211  * """
19212  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19213  * cdef size_t itemsize = src.memview.view.itemsize
19214  * cdef int i
19215  */
19216  __Pyx_TraceLine(1276,1,__PYX_ERR(1, 1276, __pyx_L1_error))
19217  __pyx_v_tmpdata = NULL;
19218 
19219  /* "View.MemoryView":1277
19220  * """
19221  * cdef void *tmpdata = NULL
19222  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19223  * cdef int i
19224  * cdef char order = get_best_order(&src, src_ndim)
19225  */
19226  __Pyx_TraceLine(1277,1,__PYX_ERR(1, 1277, __pyx_L1_error))
19227  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19228  __pyx_v_itemsize = __pyx_t_1;
19229 
19230  /* "View.MemoryView":1279
19231  * cdef size_t itemsize = src.memview.view.itemsize
19232  * cdef int i
19233  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19234  * cdef bint broadcasting = False
19235  * cdef bint direct_copy = False
19236  */
19237  __Pyx_TraceLine(1279,1,__PYX_ERR(1, 1279, __pyx_L1_error))
19238  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19239 
19240  /* "View.MemoryView":1280
19241  * cdef int i
19242  * cdef char order = get_best_order(&src, src_ndim)
19243  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19244  * cdef bint direct_copy = False
19245  * cdef __Pyx_memviewslice tmp
19246  */
19247  __Pyx_TraceLine(1280,1,__PYX_ERR(1, 1280, __pyx_L1_error))
19248  __pyx_v_broadcasting = 0;
19249 
19250  /* "View.MemoryView":1281
19251  * cdef char order = get_best_order(&src, src_ndim)
19252  * cdef bint broadcasting = False
19253  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19254  * cdef __Pyx_memviewslice tmp
19255  *
19256  */
19257  __Pyx_TraceLine(1281,1,__PYX_ERR(1, 1281, __pyx_L1_error))
19258  __pyx_v_direct_copy = 0;
19259 
19260  /* "View.MemoryView":1284
19261  * cdef __Pyx_memviewslice tmp
19262  *
19263  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19264  * broadcast_leading(&src, src_ndim, dst_ndim)
19265  * elif dst_ndim < src_ndim:
19266  */
19267  __Pyx_TraceLine(1284,1,__PYX_ERR(1, 1284, __pyx_L1_error))
19268  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19269  if (__pyx_t_2) {
19270 
19271  /* "View.MemoryView":1285
19272  *
19273  * if src_ndim < dst_ndim:
19274  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19275  * elif dst_ndim < src_ndim:
19276  * broadcast_leading(&dst, dst_ndim, src_ndim)
19277  */
19278  __Pyx_TraceLine(1285,1,__PYX_ERR(1, 1285, __pyx_L1_error))
19279  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19280 
19281  /* "View.MemoryView":1284
19282  * cdef __Pyx_memviewslice tmp
19283  *
19284  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19285  * broadcast_leading(&src, src_ndim, dst_ndim)
19286  * elif dst_ndim < src_ndim:
19287  */
19288  goto __pyx_L3;
19289  }
19290 
19291  /* "View.MemoryView":1286
19292  * if src_ndim < dst_ndim:
19293  * broadcast_leading(&src, src_ndim, dst_ndim)
19294  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19295  * broadcast_leading(&dst, dst_ndim, src_ndim)
19296  *
19297  */
19298  __Pyx_TraceLine(1286,1,__PYX_ERR(1, 1286, __pyx_L1_error))
19299  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19300  if (__pyx_t_2) {
19301 
19302  /* "View.MemoryView":1287
19303  * broadcast_leading(&src, src_ndim, dst_ndim)
19304  * elif dst_ndim < src_ndim:
19305  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19306  *
19307  * cdef int ndim = max(src_ndim, dst_ndim)
19308  */
19309  __Pyx_TraceLine(1287,1,__PYX_ERR(1, 1287, __pyx_L1_error))
19310  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19311 
19312  /* "View.MemoryView":1286
19313  * if src_ndim < dst_ndim:
19314  * broadcast_leading(&src, src_ndim, dst_ndim)
19315  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19316  * broadcast_leading(&dst, dst_ndim, src_ndim)
19317  *
19318  */
19319  }
19320  __pyx_L3:;
19321 
19322  /* "View.MemoryView":1289
19323  * broadcast_leading(&dst, dst_ndim, src_ndim)
19324  *
19325  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19326  *
19327  * for i in range(ndim):
19328  */
19329  __Pyx_TraceLine(1289,1,__PYX_ERR(1, 1289, __pyx_L1_error))
19330  __pyx_t_3 = __pyx_v_dst_ndim;
19331  __pyx_t_4 = __pyx_v_src_ndim;
19332  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19333  __pyx_t_5 = __pyx_t_3;
19334  } else {
19335  __pyx_t_5 = __pyx_t_4;
19336  }
19337  __pyx_v_ndim = __pyx_t_5;
19338 
19339  /* "View.MemoryView":1291
19340  * cdef int ndim = max(src_ndim, dst_ndim)
19341  *
19342  * for i in range(ndim): # <<<<<<<<<<<<<<
19343  * if src.shape[i] != dst.shape[i]:
19344  * if src.shape[i] == 1:
19345  */
19346  __Pyx_TraceLine(1291,1,__PYX_ERR(1, 1291, __pyx_L1_error))
19347  __pyx_t_5 = __pyx_v_ndim;
19348  __pyx_t_3 = __pyx_t_5;
19349  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19350  __pyx_v_i = __pyx_t_4;
19351 
19352  /* "View.MemoryView":1292
19353  *
19354  * for i in range(ndim):
19355  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19356  * if src.shape[i] == 1:
19357  * broadcasting = True
19358  */
19359  __Pyx_TraceLine(1292,1,__PYX_ERR(1, 1292, __pyx_L1_error))
19360  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19361  if (__pyx_t_2) {
19362 
19363  /* "View.MemoryView":1293
19364  * for i in range(ndim):
19365  * if src.shape[i] != dst.shape[i]:
19366  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19367  * broadcasting = True
19368  * src.strides[i] = 0
19369  */
19370  __Pyx_TraceLine(1293,1,__PYX_ERR(1, 1293, __pyx_L1_error))
19371  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19372  if (__pyx_t_2) {
19373 
19374  /* "View.MemoryView":1294
19375  * if src.shape[i] != dst.shape[i]:
19376  * if src.shape[i] == 1:
19377  * broadcasting = True # <<<<<<<<<<<<<<
19378  * src.strides[i] = 0
19379  * else:
19380  */
19381  __Pyx_TraceLine(1294,1,__PYX_ERR(1, 1294, __pyx_L1_error))
19382  __pyx_v_broadcasting = 1;
19383 
19384  /* "View.MemoryView":1295
19385  * if src.shape[i] == 1:
19386  * broadcasting = True
19387  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19388  * else:
19389  * _err_extents(i, dst.shape[i], src.shape[i])
19390  */
19391  __Pyx_TraceLine(1295,1,__PYX_ERR(1, 1295, __pyx_L1_error))
19392  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19393 
19394  /* "View.MemoryView":1293
19395  * for i in range(ndim):
19396  * if src.shape[i] != dst.shape[i]:
19397  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19398  * broadcasting = True
19399  * src.strides[i] = 0
19400  */
19401  goto __pyx_L7;
19402  }
19403 
19404  /* "View.MemoryView":1297
19405  * src.strides[i] = 0
19406  * else:
19407  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19408  *
19409  * if src.suboffsets[i] >= 0:
19410  */
19411  __Pyx_TraceLine(1297,1,__PYX_ERR(1, 1297, __pyx_L1_error))
19412  /*else*/ {
19413  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1297, __pyx_L1_error)
19414  }
19415  __pyx_L7:;
19416 
19417  /* "View.MemoryView":1292
19418  *
19419  * for i in range(ndim):
19420  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19421  * if src.shape[i] == 1:
19422  * broadcasting = True
19423  */
19424  }
19425 
19426  /* "View.MemoryView":1299
19427  * _err_extents(i, dst.shape[i], src.shape[i])
19428  *
19429  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19430  * _err_dim(ValueError, "Dimension %d is not direct", i)
19431  *
19432  */
19433  __Pyx_TraceLine(1299,1,__PYX_ERR(1, 1299, __pyx_L1_error))
19434  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19435  if (__pyx_t_2) {
19436 
19437  /* "View.MemoryView":1300
19438  *
19439  * if src.suboffsets[i] >= 0:
19440  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19441  *
19442  * if slices_overlap(&src, &dst, ndim, itemsize):
19443  */
19444  __Pyx_TraceLine(1300,1,__PYX_ERR(1, 1300, __pyx_L1_error))
19445  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(1, 1300, __pyx_L1_error)
19446 
19447  /* "View.MemoryView":1299
19448  * _err_extents(i, dst.shape[i], src.shape[i])
19449  *
19450  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19451  * _err_dim(ValueError, "Dimension %d is not direct", i)
19452  *
19453  */
19454  }
19455  }
19456 
19457  /* "View.MemoryView":1302
19458  * _err_dim(ValueError, "Dimension %d is not direct", i)
19459  *
19460  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19461  *
19462  * if not slice_is_contig(src, order, ndim):
19463  */
19464  __Pyx_TraceLine(1302,1,__PYX_ERR(1, 1302, __pyx_L1_error))
19465  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19466  if (__pyx_t_2) {
19467 
19468  /* "View.MemoryView":1304
19469  * if slices_overlap(&src, &dst, ndim, itemsize):
19470  *
19471  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19472  * order = get_best_order(&dst, ndim)
19473  *
19474  */
19475  __Pyx_TraceLine(1304,1,__PYX_ERR(1, 1304, __pyx_L1_error))
19476  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19477  if (__pyx_t_2) {
19478 
19479  /* "View.MemoryView":1305
19480  *
19481  * if not slice_is_contig(src, order, ndim):
19482  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19483  *
19484  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19485  */
19486  __Pyx_TraceLine(1305,1,__PYX_ERR(1, 1305, __pyx_L1_error))
19487  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19488 
19489  /* "View.MemoryView":1304
19490  * if slices_overlap(&src, &dst, ndim, itemsize):
19491  *
19492  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19493  * order = get_best_order(&dst, ndim)
19494  *
19495  */
19496  }
19497 
19498  /* "View.MemoryView":1307
19499  * order = get_best_order(&dst, ndim)
19500  *
19501  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19502  * src = tmp
19503  *
19504  */
19505  __Pyx_TraceLine(1307,1,__PYX_ERR(1, 1307, __pyx_L1_error))
19506  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(1, 1307, __pyx_L1_error)
19507  __pyx_v_tmpdata = __pyx_t_7;
19508 
19509  /* "View.MemoryView":1308
19510  *
19511  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19512  * src = tmp # <<<<<<<<<<<<<<
19513  *
19514  * if not broadcasting:
19515  */
19516  __Pyx_TraceLine(1308,1,__PYX_ERR(1, 1308, __pyx_L1_error))
19517  __pyx_v_src = __pyx_v_tmp;
19518 
19519  /* "View.MemoryView":1302
19520  * _err_dim(ValueError, "Dimension %d is not direct", i)
19521  *
19522  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19523  *
19524  * if not slice_is_contig(src, order, ndim):
19525  */
19526  }
19527 
19528  /* "View.MemoryView":1310
19529  * src = tmp
19530  *
19531  * if not broadcasting: # <<<<<<<<<<<<<<
19532  *
19533  *
19534  */
19535  __Pyx_TraceLine(1310,1,__PYX_ERR(1, 1310, __pyx_L1_error))
19536  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19537  if (__pyx_t_2) {
19538 
19539  /* "View.MemoryView":1313
19540  *
19541  *
19542  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19543  * direct_copy = slice_is_contig(dst, 'C', ndim)
19544  * elif slice_is_contig(src, 'F', ndim):
19545  */
19546  __Pyx_TraceLine(1313,1,__PYX_ERR(1, 1313, __pyx_L1_error))
19547  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19548  if (__pyx_t_2) {
19549 
19550  /* "View.MemoryView":1314
19551  *
19552  * if slice_is_contig(src, 'C', ndim):
19553  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19554  * elif slice_is_contig(src, 'F', ndim):
19555  * direct_copy = slice_is_contig(dst, 'F', ndim)
19556  */
19557  __Pyx_TraceLine(1314,1,__PYX_ERR(1, 1314, __pyx_L1_error))
19558  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19559 
19560  /* "View.MemoryView":1313
19561  *
19562  *
19563  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19564  * direct_copy = slice_is_contig(dst, 'C', ndim)
19565  * elif slice_is_contig(src, 'F', ndim):
19566  */
19567  goto __pyx_L12;
19568  }
19569 
19570  /* "View.MemoryView":1315
19571  * if slice_is_contig(src, 'C', ndim):
19572  * direct_copy = slice_is_contig(dst, 'C', ndim)
19573  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19574  * direct_copy = slice_is_contig(dst, 'F', ndim)
19575  *
19576  */
19577  __Pyx_TraceLine(1315,1,__PYX_ERR(1, 1315, __pyx_L1_error))
19578  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19579  if (__pyx_t_2) {
19580 
19581  /* "View.MemoryView":1316
19582  * direct_copy = slice_is_contig(dst, 'C', ndim)
19583  * elif slice_is_contig(src, 'F', ndim):
19584  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19585  *
19586  * if direct_copy:
19587  */
19588  __Pyx_TraceLine(1316,1,__PYX_ERR(1, 1316, __pyx_L1_error))
19589  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19590 
19591  /* "View.MemoryView":1315
19592  * if slice_is_contig(src, 'C', ndim):
19593  * direct_copy = slice_is_contig(dst, 'C', ndim)
19594  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19595  * direct_copy = slice_is_contig(dst, 'F', ndim)
19596  *
19597  */
19598  }
19599  __pyx_L12:;
19600 
19601  /* "View.MemoryView":1318
19602  * direct_copy = slice_is_contig(dst, 'F', ndim)
19603  *
19604  * if direct_copy: # <<<<<<<<<<<<<<
19605  *
19606  * refcount_copying(&dst, dtype_is_object, ndim, False)
19607  */
19608  __Pyx_TraceLine(1318,1,__PYX_ERR(1, 1318, __pyx_L1_error))
19609  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19610  if (__pyx_t_2) {
19611 
19612  /* "View.MemoryView":1320
19613  * if direct_copy:
19614  *
19615  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19616  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19617  * refcount_copying(&dst, dtype_is_object, ndim, True)
19618  */
19619  __Pyx_TraceLine(1320,1,__PYX_ERR(1, 1320, __pyx_L1_error))
19620  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19621 
19622  /* "View.MemoryView":1321
19623  *
19624  * refcount_copying(&dst, dtype_is_object, ndim, False)
19625  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19626  * refcount_copying(&dst, dtype_is_object, ndim, True)
19627  * free(tmpdata)
19628  */
19629  __Pyx_TraceLine(1321,1,__PYX_ERR(1, 1321, __pyx_L1_error))
19630  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19631 
19632  /* "View.MemoryView":1322
19633  * refcount_copying(&dst, dtype_is_object, ndim, False)
19634  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19635  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19636  * free(tmpdata)
19637  * return 0
19638  */
19639  __Pyx_TraceLine(1322,1,__PYX_ERR(1, 1322, __pyx_L1_error))
19640  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19641 
19642  /* "View.MemoryView":1323
19643  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19644  * refcount_copying(&dst, dtype_is_object, ndim, True)
19645  * free(tmpdata) # <<<<<<<<<<<<<<
19646  * return 0
19647  *
19648  */
19649  __Pyx_TraceLine(1323,1,__PYX_ERR(1, 1323, __pyx_L1_error))
19650  free(__pyx_v_tmpdata);
19651 
19652  /* "View.MemoryView":1324
19653  * refcount_copying(&dst, dtype_is_object, ndim, True)
19654  * free(tmpdata)
19655  * return 0 # <<<<<<<<<<<<<<
19656  *
19657  * if order == 'F' == get_best_order(&dst, ndim):
19658  */
19659  __Pyx_TraceLine(1324,1,__PYX_ERR(1, 1324, __pyx_L1_error))
19660  __pyx_r = 0;
19661  goto __pyx_L0;
19662 
19663  /* "View.MemoryView":1318
19664  * direct_copy = slice_is_contig(dst, 'F', ndim)
19665  *
19666  * if direct_copy: # <<<<<<<<<<<<<<
19667  *
19668  * refcount_copying(&dst, dtype_is_object, ndim, False)
19669  */
19670  }
19671 
19672  /* "View.MemoryView":1310
19673  * src = tmp
19674  *
19675  * if not broadcasting: # <<<<<<<<<<<<<<
19676  *
19677  *
19678  */
19679  }
19680 
19681  /* "View.MemoryView":1326
19682  * return 0
19683  *
19684  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19685  *
19686  *
19687  */
19688  __Pyx_TraceLine(1326,1,__PYX_ERR(1, 1326, __pyx_L1_error))
19689  __pyx_t_2 = (__pyx_v_order == 'F');
19690  if (__pyx_t_2) {
19691  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19692  }
19693  __pyx_t_8 = (__pyx_t_2 != 0);
19694  if (__pyx_t_8) {
19695 
19696  /* "View.MemoryView":1329
19697  *
19698  *
19699  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19700  * transpose_memslice(&dst)
19701  *
19702  */
19703  __Pyx_TraceLine(1329,1,__PYX_ERR(1, 1329, __pyx_L1_error))
19704  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1329, __pyx_L1_error)
19705 
19706  /* "View.MemoryView":1330
19707  *
19708  * transpose_memslice(&src)
19709  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19710  *
19711  * refcount_copying(&dst, dtype_is_object, ndim, False)
19712  */
19713  __Pyx_TraceLine(1330,1,__PYX_ERR(1, 1330, __pyx_L1_error))
19714  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(1, 1330, __pyx_L1_error)
19715 
19716  /* "View.MemoryView":1326
19717  * return 0
19718  *
19719  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19720  *
19721  *
19722  */
19723  }
19724 
19725  /* "View.MemoryView":1332
19726  * transpose_memslice(&dst)
19727  *
19728  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19729  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19730  * refcount_copying(&dst, dtype_is_object, ndim, True)
19731  */
19732  __Pyx_TraceLine(1332,1,__PYX_ERR(1, 1332, __pyx_L1_error))
19733  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19734 
19735  /* "View.MemoryView":1333
19736  *
19737  * refcount_copying(&dst, dtype_is_object, ndim, False)
19738  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19739  * refcount_copying(&dst, dtype_is_object, ndim, True)
19740  *
19741  */
19742  __Pyx_TraceLine(1333,1,__PYX_ERR(1, 1333, __pyx_L1_error))
19743  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19744 
19745  /* "View.MemoryView":1334
19746  * refcount_copying(&dst, dtype_is_object, ndim, False)
19747  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19748  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19749  *
19750  * free(tmpdata)
19751  */
19752  __Pyx_TraceLine(1334,1,__PYX_ERR(1, 1334, __pyx_L1_error))
19753  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19754 
19755  /* "View.MemoryView":1336
19756  * refcount_copying(&dst, dtype_is_object, ndim, True)
19757  *
19758  * free(tmpdata) # <<<<<<<<<<<<<<
19759  * return 0
19760  *
19761  */
19762  __Pyx_TraceLine(1336,1,__PYX_ERR(1, 1336, __pyx_L1_error))
19763  free(__pyx_v_tmpdata);
19764 
19765  /* "View.MemoryView":1337
19766  *
19767  * free(tmpdata)
19768  * return 0 # <<<<<<<<<<<<<<
19769  *
19770  * @cname('__pyx_memoryview_broadcast_leading')
19771  */
19772  __Pyx_TraceLine(1337,1,__PYX_ERR(1, 1337, __pyx_L1_error))
19773  __pyx_r = 0;
19774  goto __pyx_L0;
19775 
19776  /* "View.MemoryView":1268
19777  *
19778  * @cname('__pyx_memoryview_copy_contents')
19779  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19780  * __Pyx_memviewslice dst,
19781  * int src_ndim, int dst_ndim,
19782  */
19783 
19784  /* function exit code */
19785  __pyx_L1_error:;
19786  {
19787  #ifdef WITH_THREAD
19788  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19789  #endif
19790  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19791  #ifdef WITH_THREAD
19792  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19793  #endif
19794  }
19795  __pyx_r = -1;
19796  __pyx_L0:;
19797  __Pyx_TraceReturn(Py_None, 1);
19798  return __pyx_r;
19799 }
19800 
19801 /* "View.MemoryView":1340
19802  *
19803  * @cname('__pyx_memoryview_broadcast_leading')
19804  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19805  * int ndim,
19806  * int ndim_other) nogil:
19807  */
19808 
19809 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19810  int __pyx_v_i;
19811  int __pyx_v_offset;
19812  __Pyx_TraceDeclarations
19813  int __pyx_t_1;
19814  int __pyx_t_2;
19815  int __pyx_t_3;
19816  int __pyx_lineno = 0;
19817  const char *__pyx_filename = NULL;
19818  int __pyx_clineno = 0;
19819  __Pyx_TraceCall("broadcast_leading", __pyx_f[1], 1340, 1, __PYX_ERR(1, 1340, __pyx_L1_error));
19820 
19821  /* "View.MemoryView":1344
19822  * int ndim_other) nogil:
19823  * cdef int i
19824  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19825  *
19826  * for i in range(ndim - 1, -1, -1):
19827  */
19828  __Pyx_TraceLine(1344,1,__PYX_ERR(1, 1344, __pyx_L1_error))
19829  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19830 
19831  /* "View.MemoryView":1346
19832  * cdef int offset = ndim_other - ndim
19833  *
19834  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19835  * mslice.shape[i + offset] = mslice.shape[i]
19836  * mslice.strides[i + offset] = mslice.strides[i]
19837  */
19838  __Pyx_TraceLine(1346,1,__PYX_ERR(1, 1346, __pyx_L1_error))
19839  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19840  __pyx_v_i = __pyx_t_1;
19841 
19842  /* "View.MemoryView":1347
19843  *
19844  * for i in range(ndim - 1, -1, -1):
19845  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19846  * mslice.strides[i + offset] = mslice.strides[i]
19847  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19848  */
19849  __Pyx_TraceLine(1347,1,__PYX_ERR(1, 1347, __pyx_L1_error))
19850  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19851 
19852  /* "View.MemoryView":1348
19853  * for i in range(ndim - 1, -1, -1):
19854  * mslice.shape[i + offset] = mslice.shape[i]
19855  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19856  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19857  *
19858  */
19859  __Pyx_TraceLine(1348,1,__PYX_ERR(1, 1348, __pyx_L1_error))
19860  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19861 
19862  /* "View.MemoryView":1349
19863  * mslice.shape[i + offset] = mslice.shape[i]
19864  * mslice.strides[i + offset] = mslice.strides[i]
19865  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19866  *
19867  * for i in range(offset):
19868  */
19869  __Pyx_TraceLine(1349,1,__PYX_ERR(1, 1349, __pyx_L1_error))
19870  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19871  }
19872 
19873  /* "View.MemoryView":1351
19874  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19875  *
19876  * for i in range(offset): # <<<<<<<<<<<<<<
19877  * mslice.shape[i] = 1
19878  * mslice.strides[i] = mslice.strides[0]
19879  */
19880  __Pyx_TraceLine(1351,1,__PYX_ERR(1, 1351, __pyx_L1_error))
19881  __pyx_t_1 = __pyx_v_offset;
19882  __pyx_t_2 = __pyx_t_1;
19883  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19884  __pyx_v_i = __pyx_t_3;
19885 
19886  /* "View.MemoryView":1352
19887  *
19888  * for i in range(offset):
19889  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19890  * mslice.strides[i] = mslice.strides[0]
19891  * mslice.suboffsets[i] = -1
19892  */
19893  __Pyx_TraceLine(1352,1,__PYX_ERR(1, 1352, __pyx_L1_error))
19894  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19895 
19896  /* "View.MemoryView":1353
19897  * for i in range(offset):
19898  * mslice.shape[i] = 1
19899  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19900  * mslice.suboffsets[i] = -1
19901  *
19902  */
19903  __Pyx_TraceLine(1353,1,__PYX_ERR(1, 1353, __pyx_L1_error))
19904  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19905 
19906  /* "View.MemoryView":1354
19907  * mslice.shape[i] = 1
19908  * mslice.strides[i] = mslice.strides[0]
19909  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19910  *
19911  *
19912  */
19913  __Pyx_TraceLine(1354,1,__PYX_ERR(1, 1354, __pyx_L1_error))
19914  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19915  }
19916 
19917  /* "View.MemoryView":1340
19918  *
19919  * @cname('__pyx_memoryview_broadcast_leading')
19920  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19921  * int ndim,
19922  * int ndim_other) nogil:
19923  */
19924 
19925  /* function exit code */
19926  goto __pyx_L0;
19927  __pyx_L1_error:;
19928  __Pyx_WriteUnraisable("View.MemoryView.broadcast_leading", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19929  __pyx_L0:;
19930  __Pyx_TraceReturn(Py_None, 1);
19931 }
19932 
19933 /* "View.MemoryView":1362
19934  *
19935  * @cname('__pyx_memoryview_refcount_copying')
19936  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19937  * int ndim, bint inc) nogil:
19938  *
19939  */
19940 
19941 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19942  __Pyx_TraceDeclarations
19943  int __pyx_t_1;
19944  int __pyx_lineno = 0;
19945  const char *__pyx_filename = NULL;
19946  int __pyx_clineno = 0;
19947  __Pyx_TraceCall("refcount_copying", __pyx_f[1], 1362, 1, __PYX_ERR(1, 1362, __pyx_L1_error));
19948 
19949  /* "View.MemoryView":1366
19950  *
19951  *
19952  * if dtype_is_object: # <<<<<<<<<<<<<<
19953  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19954  * dst.strides, ndim, inc)
19955  */
19956  __Pyx_TraceLine(1366,1,__PYX_ERR(1, 1366, __pyx_L1_error))
19957  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19958  if (__pyx_t_1) {
19959 
19960  /* "View.MemoryView":1367
19961  *
19962  * if dtype_is_object:
19963  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19964  * dst.strides, ndim, inc)
19965  *
19966  */
19967  __Pyx_TraceLine(1367,1,__PYX_ERR(1, 1367, __pyx_L1_error))
19968  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19969 
19970  /* "View.MemoryView":1366
19971  *
19972  *
19973  * if dtype_is_object: # <<<<<<<<<<<<<<
19974  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19975  * dst.strides, ndim, inc)
19976  */
19977  }
19978 
19979  /* "View.MemoryView":1362
19980  *
19981  * @cname('__pyx_memoryview_refcount_copying')
19982  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19983  * int ndim, bint inc) nogil:
19984  *
19985  */
19986 
19987  /* function exit code */
19988  goto __pyx_L0;
19989  __pyx_L1_error:;
19990  __Pyx_WriteUnraisable("View.MemoryView.refcount_copying", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
19991  __pyx_L0:;
19992  __Pyx_TraceReturn(Py_None, 1);
19993 }
19994 
19995 /* "View.MemoryView":1371
19996  *
19997  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19998  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19999  * Py_ssize_t *strides, int ndim,
20000  * bint inc) with gil:
20001  */
20002 
20003 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20004  __Pyx_TraceDeclarations
20005  __Pyx_RefNannyDeclarations
20006  int __pyx_lineno = 0;
20007  const char *__pyx_filename = NULL;
20008  int __pyx_clineno = 0;
20009  #ifdef WITH_THREAD
20010  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
20011  #endif
20012  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
20013  __Pyx_TraceCall("refcount_objects_in_slice_with_gil", __pyx_f[1], 1371, 0, __PYX_ERR(1, 1371, __pyx_L1_error));
20014 
20015  /* "View.MemoryView":1374
20016  * Py_ssize_t *strides, int ndim,
20017  * bint inc) with gil:
20018  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
20019  *
20020  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20021  */
20022  __Pyx_TraceLine(1374,0,__PYX_ERR(1, 1374, __pyx_L1_error))
20023  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
20024 
20025  /* "View.MemoryView":1371
20026  *
20027  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
20028  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20029  * Py_ssize_t *strides, int ndim,
20030  * bint inc) with gil:
20031  */
20032 
20033  /* function exit code */
20034  goto __pyx_L0;
20035  __pyx_L1_error:;
20036  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice_with_gil", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20037  __pyx_L0:;
20038  __Pyx_TraceReturn(Py_None, 0);
20039  __Pyx_RefNannyFinishContext();
20040  #ifdef WITH_THREAD
20041  __Pyx_PyGILState_Release(__pyx_gilstate_save);
20042  #endif
20043 }
20044 
20045 /* "View.MemoryView":1377
20046  *
20047  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20048  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20049  * Py_ssize_t *strides, int ndim, bint inc):
20050  * cdef Py_ssize_t i
20051  */
20052 
20053 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
20054  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20055  __Pyx_TraceDeclarations
20056  __Pyx_RefNannyDeclarations
20057  Py_ssize_t __pyx_t_1;
20058  Py_ssize_t __pyx_t_2;
20059  Py_ssize_t __pyx_t_3;
20060  int __pyx_t_4;
20061  int __pyx_lineno = 0;
20062  const char *__pyx_filename = NULL;
20063  int __pyx_clineno = 0;
20064  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20065  __Pyx_TraceCall("refcount_objects_in_slice", __pyx_f[1], 1377, 0, __PYX_ERR(1, 1377, __pyx_L1_error));
20066 
20067  /* "View.MemoryView":1381
20068  * cdef Py_ssize_t i
20069  *
20070  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20071  * if ndim == 1:
20072  * if inc:
20073  */
20074  __Pyx_TraceLine(1381,0,__PYX_ERR(1, 1381, __pyx_L1_error))
20075  __pyx_t_1 = (__pyx_v_shape[0]);
20076  __pyx_t_2 = __pyx_t_1;
20077  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20078  __pyx_v_i = __pyx_t_3;
20079 
20080  /* "View.MemoryView":1382
20081  *
20082  * for i in range(shape[0]):
20083  * if ndim == 1: # <<<<<<<<<<<<<<
20084  * if inc:
20085  * Py_INCREF((<PyObject **> data)[0])
20086  */
20087  __Pyx_TraceLine(1382,0,__PYX_ERR(1, 1382, __pyx_L1_error))
20088  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20089  if (__pyx_t_4) {
20090 
20091  /* "View.MemoryView":1383
20092  * for i in range(shape[0]):
20093  * if ndim == 1:
20094  * if inc: # <<<<<<<<<<<<<<
20095  * Py_INCREF((<PyObject **> data)[0])
20096  * else:
20097  */
20098  __Pyx_TraceLine(1383,0,__PYX_ERR(1, 1383, __pyx_L1_error))
20099  __pyx_t_4 = (__pyx_v_inc != 0);
20100  if (__pyx_t_4) {
20101 
20102  /* "View.MemoryView":1384
20103  * if ndim == 1:
20104  * if inc:
20105  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20106  * else:
20107  * Py_DECREF((<PyObject **> data)[0])
20108  */
20109  __Pyx_TraceLine(1384,0,__PYX_ERR(1, 1384, __pyx_L1_error))
20110  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20111 
20112  /* "View.MemoryView":1383
20113  * for i in range(shape[0]):
20114  * if ndim == 1:
20115  * if inc: # <<<<<<<<<<<<<<
20116  * Py_INCREF((<PyObject **> data)[0])
20117  * else:
20118  */
20119  goto __pyx_L6;
20120  }
20121 
20122  /* "View.MemoryView":1386
20123  * Py_INCREF((<PyObject **> data)[0])
20124  * else:
20125  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20126  * else:
20127  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20128  */
20129  __Pyx_TraceLine(1386,0,__PYX_ERR(1, 1386, __pyx_L1_error))
20130  /*else*/ {
20131  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20132  }
20133  __pyx_L6:;
20134 
20135  /* "View.MemoryView":1382
20136  *
20137  * for i in range(shape[0]):
20138  * if ndim == 1: # <<<<<<<<<<<<<<
20139  * if inc:
20140  * Py_INCREF((<PyObject **> data)[0])
20141  */
20142  goto __pyx_L5;
20143  }
20144 
20145  /* "View.MemoryView":1388
20146  * Py_DECREF((<PyObject **> data)[0])
20147  * else:
20148  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20149  * ndim - 1, inc)
20150  *
20151  */
20152  __Pyx_TraceLine(1388,0,__PYX_ERR(1, 1388, __pyx_L1_error))
20153  /*else*/ {
20154 
20155  /* "View.MemoryView":1389
20156  * else:
20157  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20158  * ndim - 1, inc) # <<<<<<<<<<<<<<
20159  *
20160  * data += strides[0]
20161  */
20162  __Pyx_TraceLine(1389,0,__PYX_ERR(1, 1389, __pyx_L1_error))
20163  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20164  }
20165  __pyx_L5:;
20166 
20167  /* "View.MemoryView":1391
20168  * ndim - 1, inc)
20169  *
20170  * data += strides[0] # <<<<<<<<<<<<<<
20171  *
20172  *
20173  */
20174  __Pyx_TraceLine(1391,0,__PYX_ERR(1, 1391, __pyx_L1_error))
20175  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20176  }
20177 
20178  /* "View.MemoryView":1377
20179  *
20180  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20181  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20182  * Py_ssize_t *strides, int ndim, bint inc):
20183  * cdef Py_ssize_t i
20184  */
20185 
20186  /* function exit code */
20187  goto __pyx_L0;
20188  __pyx_L1_error:;
20189  __Pyx_WriteUnraisable("View.MemoryView.refcount_objects_in_slice", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
20190  __pyx_L0:;
20191  __Pyx_TraceReturn(Py_None, 0);
20192  __Pyx_RefNannyFinishContext();
20193 }
20194 
20195 /* "View.MemoryView":1397
20196  *
20197  * @cname('__pyx_memoryview_slice_assign_scalar')
20198  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20199  * size_t itemsize, void *item,
20200  * bint dtype_is_object) nogil:
20201  */
20202 
20203 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20204  __Pyx_TraceDeclarations
20205  int __pyx_lineno = 0;
20206  const char *__pyx_filename = NULL;
20207  int __pyx_clineno = 0;
20208  __Pyx_TraceCall("slice_assign_scalar", __pyx_f[1], 1397, 1, __PYX_ERR(1, 1397, __pyx_L1_error));
20209 
20210  /* "View.MemoryView":1400
20211  * size_t itemsize, void *item,
20212  * bint dtype_is_object) nogil:
20213  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20214  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20215  * itemsize, item)
20216  */
20217  __Pyx_TraceLine(1400,1,__PYX_ERR(1, 1400, __pyx_L1_error))
20218  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20219 
20220  /* "View.MemoryView":1401
20221  * bint dtype_is_object) nogil:
20222  * refcount_copying(dst, dtype_is_object, ndim, False)
20223  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20224  * itemsize, item)
20225  * refcount_copying(dst, dtype_is_object, ndim, True)
20226  */
20227  __Pyx_TraceLine(1401,1,__PYX_ERR(1, 1401, __pyx_L1_error))
20228  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20229 
20230  /* "View.MemoryView":1403
20231  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20232  * itemsize, item)
20233  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20234  *
20235  *
20236  */
20237  __Pyx_TraceLine(1403,1,__PYX_ERR(1, 1403, __pyx_L1_error))
20238  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20239 
20240  /* "View.MemoryView":1397
20241  *
20242  * @cname('__pyx_memoryview_slice_assign_scalar')
20243  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20244  * size_t itemsize, void *item,
20245  * bint dtype_is_object) nogil:
20246  */
20247 
20248  /* function exit code */
20249  goto __pyx_L0;
20250  __pyx_L1_error:;
20251  __Pyx_WriteUnraisable("View.MemoryView.slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20252  __pyx_L0:;
20253  __Pyx_TraceReturn(Py_None, 1);
20254 }
20255 
20256 /* "View.MemoryView":1407
20257  *
20258  * @cname('__pyx_memoryview__slice_assign_scalar')
20259  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20260  * Py_ssize_t *strides, int ndim,
20261  * size_t itemsize, void *item) nogil:
20262  */
20263 
20264 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20265  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20266  Py_ssize_t __pyx_v_stride;
20267  Py_ssize_t __pyx_v_extent;
20268  __Pyx_TraceDeclarations
20269  int __pyx_t_1;
20270  Py_ssize_t __pyx_t_2;
20271  Py_ssize_t __pyx_t_3;
20272  Py_ssize_t __pyx_t_4;
20273  int __pyx_lineno = 0;
20274  const char *__pyx_filename = NULL;
20275  int __pyx_clineno = 0;
20276  __Pyx_TraceCall("_slice_assign_scalar", __pyx_f[1], 1407, 1, __PYX_ERR(1, 1407, __pyx_L1_error));
20277 
20278  /* "View.MemoryView":1411
20279  * size_t itemsize, void *item) nogil:
20280  * cdef Py_ssize_t i
20281  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20282  * cdef Py_ssize_t extent = shape[0]
20283  *
20284  */
20285  __Pyx_TraceLine(1411,1,__PYX_ERR(1, 1411, __pyx_L1_error))
20286  __pyx_v_stride = (__pyx_v_strides[0]);
20287 
20288  /* "View.MemoryView":1412
20289  * cdef Py_ssize_t i
20290  * cdef Py_ssize_t stride = strides[0]
20291  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20292  *
20293  * if ndim == 1:
20294  */
20295  __Pyx_TraceLine(1412,1,__PYX_ERR(1, 1412, __pyx_L1_error))
20296  __pyx_v_extent = (__pyx_v_shape[0]);
20297 
20298  /* "View.MemoryView":1414
20299  * cdef Py_ssize_t extent = shape[0]
20300  *
20301  * if ndim == 1: # <<<<<<<<<<<<<<
20302  * for i in range(extent):
20303  * memcpy(data, item, itemsize)
20304  */
20305  __Pyx_TraceLine(1414,1,__PYX_ERR(1, 1414, __pyx_L1_error))
20306  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20307  if (__pyx_t_1) {
20308 
20309  /* "View.MemoryView":1415
20310  *
20311  * if ndim == 1:
20312  * for i in range(extent): # <<<<<<<<<<<<<<
20313  * memcpy(data, item, itemsize)
20314  * data += stride
20315  */
20316  __Pyx_TraceLine(1415,1,__PYX_ERR(1, 1415, __pyx_L1_error))
20317  __pyx_t_2 = __pyx_v_extent;
20318  __pyx_t_3 = __pyx_t_2;
20319  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20320  __pyx_v_i = __pyx_t_4;
20321 
20322  /* "View.MemoryView":1416
20323  * if ndim == 1:
20324  * for i in range(extent):
20325  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20326  * data += stride
20327  * else:
20328  */
20329  __Pyx_TraceLine(1416,1,__PYX_ERR(1, 1416, __pyx_L1_error))
20330  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20331 
20332  /* "View.MemoryView":1417
20333  * for i in range(extent):
20334  * memcpy(data, item, itemsize)
20335  * data += stride # <<<<<<<<<<<<<<
20336  * else:
20337  * for i in range(extent):
20338  */
20339  __Pyx_TraceLine(1417,1,__PYX_ERR(1, 1417, __pyx_L1_error))
20340  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20341  }
20342 
20343  /* "View.MemoryView":1414
20344  * cdef Py_ssize_t extent = shape[0]
20345  *
20346  * if ndim == 1: # <<<<<<<<<<<<<<
20347  * for i in range(extent):
20348  * memcpy(data, item, itemsize)
20349  */
20350  goto __pyx_L3;
20351  }
20352 
20353  /* "View.MemoryView":1419
20354  * data += stride
20355  * else:
20356  * for i in range(extent): # <<<<<<<<<<<<<<
20357  * _slice_assign_scalar(data, shape + 1, strides + 1,
20358  * ndim - 1, itemsize, item)
20359  */
20360  __Pyx_TraceLine(1419,1,__PYX_ERR(1, 1419, __pyx_L1_error))
20361  /*else*/ {
20362  __pyx_t_2 = __pyx_v_extent;
20363  __pyx_t_3 = __pyx_t_2;
20364  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20365  __pyx_v_i = __pyx_t_4;
20366 
20367  /* "View.MemoryView":1420
20368  * else:
20369  * for i in range(extent):
20370  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20371  * ndim - 1, itemsize, item)
20372  * data += stride
20373  */
20374  __Pyx_TraceLine(1420,1,__PYX_ERR(1, 1420, __pyx_L1_error))
20375  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20376 
20377  /* "View.MemoryView":1422
20378  * _slice_assign_scalar(data, shape + 1, strides + 1,
20379  * ndim - 1, itemsize, item)
20380  * data += stride # <<<<<<<<<<<<<<
20381  *
20382  *
20383  */
20384  __Pyx_TraceLine(1422,1,__PYX_ERR(1, 1422, __pyx_L1_error))
20385  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20386  }
20387  }
20388  __pyx_L3:;
20389 
20390  /* "View.MemoryView":1407
20391  *
20392  * @cname('__pyx_memoryview__slice_assign_scalar')
20393  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20394  * Py_ssize_t *strides, int ndim,
20395  * size_t itemsize, void *item) nogil:
20396  */
20397 
20398  /* function exit code */
20399  goto __pyx_L0;
20400  __pyx_L1_error:;
20401  __Pyx_WriteUnraisable("View.MemoryView._slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 1);
20402  __pyx_L0:;
20403  __Pyx_TraceReturn(Py_None, 1);
20404 }
20405 
20406 /* "(tree fragment)":1
20407  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20408  * cdef object __pyx_PickleError
20409  * cdef object __pyx_result
20410  */
20411 
20412 /* Python wrapper */
20413 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20414 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)(void*)(PyCFunctionWithKeywords)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20415 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20416  PyObject *__pyx_v___pyx_type = 0;
20417  long __pyx_v___pyx_checksum;
20418  PyObject *__pyx_v___pyx_state = 0;
20419  int __pyx_lineno = 0;
20420  const char *__pyx_filename = NULL;
20421  int __pyx_clineno = 0;
20422  PyObject *__pyx_r = 0;
20423  __Pyx_RefNannyDeclarations
20424  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20425  {
20426  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20427  PyObject* values[3] = {0,0,0};
20428  if (unlikely(__pyx_kwds)) {
20429  Py_ssize_t kw_args;
20430  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20431  switch (pos_args) {
20432  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20433  CYTHON_FALLTHROUGH;
20434  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20435  CYTHON_FALLTHROUGH;
20436  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20437  CYTHON_FALLTHROUGH;
20438  case 0: break;
20439  default: goto __pyx_L5_argtuple_error;
20440  }
20441  kw_args = PyDict_Size(__pyx_kwds);
20442  switch (pos_args) {
20443  case 0:
20444  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20445  else goto __pyx_L5_argtuple_error;
20446  CYTHON_FALLTHROUGH;
20447  case 1:
20448  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20449  else {
20450  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
20451  }
20452  CYTHON_FALLTHROUGH;
20453  case 2:
20454  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20455  else {
20456  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
20457  }
20458  }
20459  if (unlikely(kw_args > 0)) {
20460  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
20461  }
20462  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20463  goto __pyx_L5_argtuple_error;
20464  } else {
20465  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20466  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20467  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20468  }
20469  __pyx_v___pyx_type = values[0];
20470  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
20471  __pyx_v___pyx_state = values[2];
20472  }
20473  goto __pyx_L4_argument_unpacking_done;
20474  __pyx_L5_argtuple_error:;
20475  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 1, __pyx_L3_error)
20476  __pyx_L3_error:;
20477  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20478  __Pyx_RefNannyFinishContext();
20479  return NULL;
20480  __pyx_L4_argument_unpacking_done:;
20481  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20482 
20483  /* function exit code */
20484  __Pyx_RefNannyFinishContext();
20485  return __pyx_r;
20486 }
20487 
20488 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20489  PyObject *__pyx_v___pyx_PickleError = 0;
20490  PyObject *__pyx_v___pyx_result = 0;
20491  PyObject *__pyx_r = NULL;
20492  __Pyx_TraceDeclarations
20493  __Pyx_RefNannyDeclarations
20494  int __pyx_t_1;
20495  PyObject *__pyx_t_2 = NULL;
20496  PyObject *__pyx_t_3 = NULL;
20497  PyObject *__pyx_t_4 = NULL;
20498  PyObject *__pyx_t_5 = NULL;
20499  int __pyx_t_6;
20500  int __pyx_lineno = 0;
20501  const char *__pyx_filename = NULL;
20502  int __pyx_clineno = 0;
20503  __Pyx_TraceFrameInit(__pyx_codeobj__36)
20504  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20505  __Pyx_TraceCall("__pyx_unpickle_Enum", __pyx_f[1], 1, 0, __PYX_ERR(1, 1, __pyx_L1_error));
20506 
20507  /* "(tree fragment)":4
20508  * cdef object __pyx_PickleError
20509  * cdef object __pyx_result
20510  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20511  * from pickle import PickleError as __pyx_PickleError
20512  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20513  */
20514  __Pyx_TraceLine(4,0,__PYX_ERR(1, 4, __pyx_L1_error))
20515  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20516  if (__pyx_t_1) {
20517 
20518  /* "(tree fragment)":5
20519  * cdef object __pyx_result
20520  * if __pyx_checksum != 0xb068931:
20521  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20522  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20523  * __pyx_result = Enum.__new__(__pyx_type)
20524  */
20525  __Pyx_TraceLine(5,0,__PYX_ERR(1, 5, __pyx_L1_error))
20526  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20527  __Pyx_GOTREF(__pyx_t_2);
20528  __Pyx_INCREF(__pyx_n_s_PickleError);
20529  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20530  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20531  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
20532  __Pyx_GOTREF(__pyx_t_3);
20533  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20534  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
20535  __Pyx_GOTREF(__pyx_t_2);
20536  __Pyx_INCREF(__pyx_t_2);
20537  __pyx_v___pyx_PickleError = __pyx_t_2;
20538  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20539  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20540 
20541  /* "(tree fragment)":6
20542  * if __pyx_checksum != 0xb068931:
20543  * from pickle import PickleError as __pyx_PickleError
20544  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20545  * __pyx_result = Enum.__new__(__pyx_type)
20546  * if __pyx_state is not None:
20547  */
20548  __Pyx_TraceLine(6,0,__PYX_ERR(1, 6, __pyx_L1_error))
20549  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
20550  __Pyx_GOTREF(__pyx_t_2);
20551  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 6, __pyx_L1_error)
20552  __Pyx_GOTREF(__pyx_t_4);
20553  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20554  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20555  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20556  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20557  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20558  if (likely(__pyx_t_5)) {
20559  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20560  __Pyx_INCREF(__pyx_t_5);
20561  __Pyx_INCREF(function);
20562  __Pyx_DECREF_SET(__pyx_t_2, function);
20563  }
20564  }
20565  __pyx_t_3 = (__pyx_t_5) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_5, __pyx_t_4) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4);
20566  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20567  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20568  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
20569  __Pyx_GOTREF(__pyx_t_3);
20570  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20571  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20572  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20573  __PYX_ERR(1, 6, __pyx_L1_error)
20574 
20575  /* "(tree fragment)":4
20576  * cdef object __pyx_PickleError
20577  * cdef object __pyx_result
20578  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20579  * from pickle import PickleError as __pyx_PickleError
20580  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20581  */
20582  }
20583 
20584  /* "(tree fragment)":7
20585  * from pickle import PickleError as __pyx_PickleError
20586  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20587  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20588  * if __pyx_state is not None:
20589  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20590  */
20591  __Pyx_TraceLine(7,0,__PYX_ERR(1, 7, __pyx_L1_error))
20592  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
20593  __Pyx_GOTREF(__pyx_t_2);
20594  __pyx_t_4 = NULL;
20595  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20596  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
20597  if (likely(__pyx_t_4)) {
20598  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20599  __Pyx_INCREF(__pyx_t_4);
20600  __Pyx_INCREF(function);
20601  __Pyx_DECREF_SET(__pyx_t_2, function);
20602  }
20603  }
20604  __pyx_t_3 = (__pyx_t_4) ? __Pyx_PyObject_Call2Args(__pyx_t_2, __pyx_t_4, __pyx_v___pyx_type) : __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type);
20605  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
20606  if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
20607  __Pyx_GOTREF(__pyx_t_3);
20608  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20609  __pyx_v___pyx_result = __pyx_t_3;
20610  __pyx_t_3 = 0;
20611 
20612  /* "(tree fragment)":8
20613  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20614  * __pyx_result = Enum.__new__(__pyx_type)
20615  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20616  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20617  * return __pyx_result
20618  */
20619  __Pyx_TraceLine(8,0,__PYX_ERR(1, 8, __pyx_L1_error))
20620  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20621  __pyx_t_6 = (__pyx_t_1 != 0);
20622  if (__pyx_t_6) {
20623 
20624  /* "(tree fragment)":9
20625  * __pyx_result = Enum.__new__(__pyx_type)
20626  * if __pyx_state is not None:
20627  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20628  * return __pyx_result
20629  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20630  */
20631  __Pyx_TraceLine(9,0,__PYX_ERR(1, 9, __pyx_L1_error))
20632  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(1, 9, __pyx_L1_error)
20633  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 9, __pyx_L1_error)
20634  __Pyx_GOTREF(__pyx_t_3);
20635  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20636 
20637  /* "(tree fragment)":8
20638  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20639  * __pyx_result = Enum.__new__(__pyx_type)
20640  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20641  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20642  * return __pyx_result
20643  */
20644  }
20645 
20646  /* "(tree fragment)":10
20647  * if __pyx_state is not None:
20648  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20649  * return __pyx_result # <<<<<<<<<<<<<<
20650  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20651  * __pyx_result.name = __pyx_state[0]
20652  */
20653  __Pyx_TraceLine(10,0,__PYX_ERR(1, 10, __pyx_L1_error))
20654  __Pyx_XDECREF(__pyx_r);
20655  __Pyx_INCREF(__pyx_v___pyx_result);
20656  __pyx_r = __pyx_v___pyx_result;
20657  goto __pyx_L0;
20658 
20659  /* "(tree fragment)":1
20660  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20661  * cdef object __pyx_PickleError
20662  * cdef object __pyx_result
20663  */
20664 
20665  /* function exit code */
20666  __pyx_L1_error:;
20667  __Pyx_XDECREF(__pyx_t_2);
20668  __Pyx_XDECREF(__pyx_t_3);
20669  __Pyx_XDECREF(__pyx_t_4);
20670  __Pyx_XDECREF(__pyx_t_5);
20671  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20672  __pyx_r = NULL;
20673  __pyx_L0:;
20674  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20675  __Pyx_XDECREF(__pyx_v___pyx_result);
20676  __Pyx_XGIVEREF(__pyx_r);
20677  __Pyx_TraceReturn(__pyx_r, 0);
20678  __Pyx_RefNannyFinishContext();
20679  return __pyx_r;
20680 }
20681 
20682 /* "(tree fragment)":11
20683  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20684  * return __pyx_result
20685  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20686  * __pyx_result.name = __pyx_state[0]
20687  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20688  */
20689 
20690 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20691  PyObject *__pyx_r = NULL;
20692  __Pyx_TraceDeclarations
20693  __Pyx_RefNannyDeclarations
20694  PyObject *__pyx_t_1 = NULL;
20695  int __pyx_t_2;
20696  Py_ssize_t __pyx_t_3;
20697  int __pyx_t_4;
20698  int __pyx_t_5;
20699  PyObject *__pyx_t_6 = NULL;
20700  PyObject *__pyx_t_7 = NULL;
20701  PyObject *__pyx_t_8 = NULL;
20702  int __pyx_lineno = 0;
20703  const char *__pyx_filename = NULL;
20704  int __pyx_clineno = 0;
20705  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20706  __Pyx_TraceCall("__pyx_unpickle_Enum__set_state", __pyx_f[1], 11, 0, __PYX_ERR(1, 11, __pyx_L1_error));
20707 
20708  /* "(tree fragment)":12
20709  * return __pyx_result
20710  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20711  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20712  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20713  * __pyx_result.__dict__.update(__pyx_state[1])
20714  */
20715  __Pyx_TraceLine(12,0,__PYX_ERR(1, 12, __pyx_L1_error))
20716  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20717  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20718  __PYX_ERR(1, 12, __pyx_L1_error)
20719  }
20720  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
20721  __Pyx_GOTREF(__pyx_t_1);
20722  __Pyx_GIVEREF(__pyx_t_1);
20723  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20724  __Pyx_DECREF(__pyx_v___pyx_result->name);
20725  __pyx_v___pyx_result->name = __pyx_t_1;
20726  __pyx_t_1 = 0;
20727 
20728  /* "(tree fragment)":13
20729  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20730  * __pyx_result.name = __pyx_state[0]
20731  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20732  * __pyx_result.__dict__.update(__pyx_state[1])
20733  */
20734  __Pyx_TraceLine(13,0,__PYX_ERR(1, 13, __pyx_L1_error))
20735  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20736  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20737  __PYX_ERR(1, 13, __pyx_L1_error)
20738  }
20739  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20740  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20741  if (__pyx_t_4) {
20742  } else {
20743  __pyx_t_2 = __pyx_t_4;
20744  goto __pyx_L4_bool_binop_done;
20745  }
20746  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
20747  __pyx_t_5 = (__pyx_t_4 != 0);
20748  __pyx_t_2 = __pyx_t_5;
20749  __pyx_L4_bool_binop_done:;
20750  if (__pyx_t_2) {
20751 
20752  /* "(tree fragment)":14
20753  * __pyx_result.name = __pyx_state[0]
20754  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20755  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20756  */
20757  __Pyx_TraceLine(14,0,__PYX_ERR(1, 14, __pyx_L1_error))
20758  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20759  __Pyx_GOTREF(__pyx_t_6);
20760  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
20761  __Pyx_GOTREF(__pyx_t_7);
20762  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20763  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20764  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20765  __PYX_ERR(1, 14, __pyx_L1_error)
20766  }
20767  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 14, __pyx_L1_error)
20768  __Pyx_GOTREF(__pyx_t_6);
20769  __pyx_t_8 = NULL;
20770  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20771  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20772  if (likely(__pyx_t_8)) {
20773  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20774  __Pyx_INCREF(__pyx_t_8);
20775  __Pyx_INCREF(function);
20776  __Pyx_DECREF_SET(__pyx_t_7, function);
20777  }
20778  }
20779  __pyx_t_1 = (__pyx_t_8) ? __Pyx_PyObject_Call2Args(__pyx_t_7, __pyx_t_8, __pyx_t_6) : __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6);
20780  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20781  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20782  if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
20783  __Pyx_GOTREF(__pyx_t_1);
20784  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20785  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20786 
20787  /* "(tree fragment)":13
20788  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20789  * __pyx_result.name = __pyx_state[0]
20790  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20791  * __pyx_result.__dict__.update(__pyx_state[1])
20792  */
20793  }
20794 
20795  /* "(tree fragment)":11
20796  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20797  * return __pyx_result
20798  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20799  * __pyx_result.name = __pyx_state[0]
20800  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20801  */
20802 
20803  /* function exit code */
20804  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20805  goto __pyx_L0;
20806  __pyx_L1_error:;
20807  __Pyx_XDECREF(__pyx_t_1);
20808  __Pyx_XDECREF(__pyx_t_6);
20809  __Pyx_XDECREF(__pyx_t_7);
20810  __Pyx_XDECREF(__pyx_t_8);
20811  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20812  __pyx_r = 0;
20813  __pyx_L0:;
20814  __Pyx_XGIVEREF(__pyx_r);
20815  __Pyx_TraceReturn(__pyx_r, 0);
20816  __Pyx_RefNannyFinishContext();
20817  return __pyx_r;
20818 }
20819 static struct __pyx_vtabstruct_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
20820 
20821 static PyObject *__pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyTypeObject *t, PyObject *a, PyObject *k) {
20822  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p;
20823  PyObject *o = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_new(t, a, k);
20824  if (unlikely(!o)) return 0;
20825  p = ((struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o);
20826  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
20827  p->A_csr = Py_None; Py_INCREF(Py_None);
20828  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
20829  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
20830  if (unlikely(__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_1__cinit__(o, a, k) < 0)) goto bad;
20831  return o;
20832  bad:
20833  Py_DECREF(o); o = 0;
20834  return NULL;
20835 }
20836 
20837 static void __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
20838  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
20839  #if CYTHON_USE_TP_FINALIZE
20840  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20841  if (PyObject_CallFinalizerFromDealloc(o)) return;
20842  }
20843  #endif
20844  PyObject_GC_UnTrack(o);
20845  Py_CLEAR(p->A_csr);
20846  Py_CLEAR(p->A_indices_copy);
20847  Py_CLEAR(p->A_index_pointer_copy);
20848  PyObject_GC_Track(o);
20849  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dealloc(o); else __Pyx_call_next_tp_dealloc(o, __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
20850 }
20851 
20852 static int __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o, visitproc v, void *a) {
20853  int e;
20854  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
20855  e = ((likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) ? ((__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse) ? __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_traverse(o, v, a) : 0) : __Pyx_call_next_tp_traverse(o, v, a, __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix)); if (e) return e;
20856  if (p->A_csr) {
20857  e = (*v)(p->A_csr, a); if (e) return e;
20858  }
20859  if (p->A_indices_copy) {
20860  e = (*v)(p->A_indices_copy, a); if (e) return e;
20861  }
20862  if (p->A_index_pointer_copy) {
20863  e = (*v)(p->A_index_pointer_copy, a); if (e) return e;
20864  }
20865  return 0;
20866 }
20867 
20868 static int __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix(PyObject *o) {
20869  PyObject* tmp;
20870  struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *p = (struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix *)o;
20871  if (likely(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) { if (__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear) __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_clear(o); } else __Pyx_call_next_tp_clear(o, __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
20872  tmp = ((PyObject*)p->A_csr);
20873  p->A_csr = Py_None; Py_INCREF(Py_None);
20874  Py_XDECREF(tmp);
20875  tmp = ((PyObject*)p->A_indices_copy);
20876  p->A_indices_copy = Py_None; Py_INCREF(Py_None);
20877  Py_XDECREF(tmp);
20878  tmp = ((PyObject*)p->A_index_pointer_copy);
20879  p->A_index_pointer_copy = Py_None; Py_INCREF(Py_None);
20880  Py_XDECREF(tmp);
20881  return 0;
20882 }
20883 
20884 static PyMethodDef __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix[] = {
20885  {"set_dense_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_2set_dense_matrix_float},
20886  {"set_dense_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_4set_dense_matrix_double},
20887  {"set_dense_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_6set_dense_matrix_long_double},
20888  {"set_csr_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_8set_csr_matrix_float},
20889  {"set_csr_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_10set_csr_matrix_double},
20890  {"set_csr_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_12set_csr_matrix_long_double},
20891  {"set_csc_matrix_float", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_14set_csc_matrix_float},
20892  {"set_csc_matrix_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_16set_csc_matrix_double},
20893  {"set_csc_matrix_long_double", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_18set_csc_matrix_long_double},
20894  {"__reduce_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, METH_NOARGS, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_20__reduce_cython__},
20895  {"__setstate_cython__", (PyCFunction)__pyx_pw_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, METH_O, __pyx_doc_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_22__setstate_cython__},
20896  {0, 0, 0, 0}
20897 };
20898 
20899 static PyTypeObject __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = {
20900  PyVarObject_HEAD_INIT(0, 0)
20901  "imate._c_linear_operator.py_c_matrix.pycMatrix", /*tp_name*/
20902  sizeof(struct __pyx_obj_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix), /*tp_basicsize*/
20903  0, /*tp_itemsize*/
20904  __pyx_tp_dealloc_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_dealloc*/
20905  #if PY_VERSION_HEX < 0x030800b4
20906  0, /*tp_print*/
20907  #endif
20908  #if PY_VERSION_HEX >= 0x030800b4
20909  0, /*tp_vectorcall_offset*/
20910  #endif
20911  0, /*tp_getattr*/
20912  0, /*tp_setattr*/
20913  #if PY_MAJOR_VERSION < 3
20914  0, /*tp_compare*/
20915  #endif
20916  #if PY_MAJOR_VERSION >= 3
20917  0, /*tp_as_async*/
20918  #endif
20919  0, /*tp_repr*/
20920  0, /*tp_as_number*/
20921  0, /*tp_as_sequence*/
20922  0, /*tp_as_mapping*/
20923  0, /*tp_hash*/
20924  0, /*tp_call*/
20925  0, /*tp_str*/
20926  0, /*tp_getattro*/
20927  0, /*tp_setattro*/
20928  0, /*tp_as_buffer*/
20929  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20930  "\n Defines a linear operator that is a constant matrix.\n\n **Initializing Object:**\n\n The object is initialized by a given matrix :math:`\\mathbf{A}` which can\n be a numpy array, or sparse matrices of any format (CSR, CSC, etc) using\n scipy sparse module.\n\n .. note::\n\n Initializing the linear operator requires python's GIL. Also, the\n following examples should be used in a ``*.pyx`` file and should be\n compiled as cython's extension module.\n\n In the following example, we create the object ``Aop`` based on\n scipy.sparse matrix of CSR format. Note the format of the input matrix\n can also be anything other than ``'csr'``, such as ``'csc'``.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import scipy.sparse\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> A = scipy.sparse.random(n, m, format='csr')\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n\n The following is an example of defining the operator with a dense matrix:\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> import numpy\n\n >>> # Create to random sparse matrices\n >>> n, m = 1000\n >>> cdef ConstantMatrix A = numpy.random.randn((n, m), dtype=float)\n\n >>> # Create linear operator object\n >>> from imate.linear_operator cimport ConstantMatrix\n >>> cdef ConstantMatrix Aop = ConstantMatrix(A)\n\n **Matrix-Vector Multiplications:**\n\n The linear operator can perform matrix vector multiplication using\n :func:`dot` function and the matrix-vector multiplication with the\n transposed matrix using :func:`transpose_dot` function.\n\n .. note::\n\n Matrix-vector multiplication using :func:`dot` and\n :func:`transpose_dot` functions do n""ot require python's GIL, hence,\n they can be called in a ``nogil`` environment, if desired.\n\n .. code-block:: python\n\n >>> # Use this script in a *.pyx file\n >>> # Create a vectors as cython's memoryview to numpy arrays\n >>> import numpy\n >>> cdef double[:] b = numpy.random.randn(m)\n >>> cdef double[:] c = numpy.empty((n, 1), dtype=float)\n\n >>> # Perform product on vector b and store the product on vector c\n >>> with nogil:\n ... Aop.dot(&b[0], &c[0])\n\n >>> # Perform product using the transpose of the operator\n >>> with nogil:\n >>> Aop.transpose_dot(&b[0], &c[0])\n\n .. seealso::\n\n :class:`AffineMatrixFunction`\n ", /*tp_doc*/
20931  __pyx_tp_traverse_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_traverse*/
20932  __pyx_tp_clear_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_clear*/
20933  0, /*tp_richcompare*/
20934  0, /*tp_weaklistoffset*/
20935  0, /*tp_iter*/
20936  0, /*tp_iternext*/
20937  __pyx_methods_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_methods*/
20938  0, /*tp_members*/
20939  0, /*tp_getset*/
20940  0, /*tp_base*/
20941  0, /*tp_dict*/
20942  0, /*tp_descr_get*/
20943  0, /*tp_descr_set*/
20944  0, /*tp_dictoffset*/
20945  0, /*tp_init*/
20946  0, /*tp_alloc*/
20947  __pyx_tp_new_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix, /*tp_new*/
20948  0, /*tp_free*/
20949  0, /*tp_is_gc*/
20950  0, /*tp_bases*/
20951  0, /*tp_mro*/
20952  0, /*tp_cache*/
20953  0, /*tp_subclasses*/
20954  0, /*tp_weaklist*/
20955  0, /*tp_del*/
20956  0, /*tp_version_tag*/
20957  #if PY_VERSION_HEX >= 0x030400a1
20958  0, /*tp_finalize*/
20959  #endif
20960  #if PY_VERSION_HEX >= 0x030800b1
20961  0, /*tp_vectorcall*/
20962  #endif
20963  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
20964  0, /*tp_print*/
20965  #endif
20966 };
20967 static struct __pyx_vtabstruct_array __pyx_vtable_array;
20968 
20969 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
20970  struct __pyx_array_obj *p;
20971  PyObject *o;
20972  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20973  o = (*t->tp_alloc)(t, 0);
20974  } else {
20975  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20976  }
20977  if (unlikely(!o)) return 0;
20978  p = ((struct __pyx_array_obj *)o);
20979  p->__pyx_vtab = __pyx_vtabptr_array;
20980  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
20981  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
20982  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
20983  return o;
20984  bad:
20985  Py_DECREF(o); o = 0;
20986  return NULL;
20987 }
20988 
20989 static void __pyx_tp_dealloc_array(PyObject *o) {
20990  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
20991  #if CYTHON_USE_TP_FINALIZE
20992  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
20993  if (PyObject_CallFinalizerFromDealloc(o)) return;
20994  }
20995  #endif
20996  {
20997  PyObject *etype, *eval, *etb;
20998  PyErr_Fetch(&etype, &eval, &etb);
20999  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21000  __pyx_array___dealloc__(o);
21001  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21002  PyErr_Restore(etype, eval, etb);
21003  }
21004  Py_CLEAR(p->mode);
21005  Py_CLEAR(p->_format);
21006  (*Py_TYPE(o)->tp_free)(o);
21007 }
21008 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21009  PyObject *r;
21010  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21011  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21012  Py_DECREF(x);
21013  return r;
21014 }
21015 
21016 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21017  if (v) {
21018  return __pyx_array___setitem__(o, i, v);
21019  }
21020  else {
21021  PyErr_Format(PyExc_NotImplementedError,
21022  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21023  return -1;
21024  }
21025 }
21026 
21027 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21028  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21029  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21030  PyErr_Clear();
21031  v = __pyx_array___getattr__(o, n);
21032  }
21033  return v;
21034 }
21035 
21036 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21037  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21038 }
21039 
21040 static PyMethodDef __pyx_methods_array[] = {
21041  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21042  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21043  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21044  {0, 0, 0, 0}
21045 };
21046 
21047 static struct PyGetSetDef __pyx_getsets_array[] = {
21048  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21049  {0, 0, 0, 0, 0}
21050 };
21051 
21052 static PySequenceMethods __pyx_tp_as_sequence_array = {
21053  __pyx_array___len__, /*sq_length*/
21054  0, /*sq_concat*/
21055  0, /*sq_repeat*/
21056  __pyx_sq_item_array, /*sq_item*/
21057  0, /*sq_slice*/
21058  0, /*sq_ass_item*/
21059  0, /*sq_ass_slice*/
21060  0, /*sq_contains*/
21061  0, /*sq_inplace_concat*/
21062  0, /*sq_inplace_repeat*/
21063 };
21064 
21065 static PyMappingMethods __pyx_tp_as_mapping_array = {
21066  __pyx_array___len__, /*mp_length*/
21067  __pyx_array___getitem__, /*mp_subscript*/
21068  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21069 };
21070 
21071 static PyBufferProcs __pyx_tp_as_buffer_array = {
21072  #if PY_MAJOR_VERSION < 3
21073  0, /*bf_getreadbuffer*/
21074  #endif
21075  #if PY_MAJOR_VERSION < 3
21076  0, /*bf_getwritebuffer*/
21077  #endif
21078  #if PY_MAJOR_VERSION < 3
21079  0, /*bf_getsegcount*/
21080  #endif
21081  #if PY_MAJOR_VERSION < 3
21082  0, /*bf_getcharbuffer*/
21083  #endif
21084  __pyx_array_getbuffer, /*bf_getbuffer*/
21085  0, /*bf_releasebuffer*/
21086 };
21087 
21088 static PyTypeObject __pyx_type___pyx_array = {
21089  PyVarObject_HEAD_INIT(0, 0)
21090  "imate._c_linear_operator.py_c_matrix.array", /*tp_name*/
21091  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21092  0, /*tp_itemsize*/
21093  __pyx_tp_dealloc_array, /*tp_dealloc*/
21094  #if PY_VERSION_HEX < 0x030800b4
21095  0, /*tp_print*/
21096  #endif
21097  #if PY_VERSION_HEX >= 0x030800b4
21098  0, /*tp_vectorcall_offset*/
21099  #endif
21100  0, /*tp_getattr*/
21101  0, /*tp_setattr*/
21102  #if PY_MAJOR_VERSION < 3
21103  0, /*tp_compare*/
21104  #endif
21105  #if PY_MAJOR_VERSION >= 3
21106  0, /*tp_as_async*/
21107  #endif
21108  0, /*tp_repr*/
21109  0, /*tp_as_number*/
21110  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21111  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21112  0, /*tp_hash*/
21113  0, /*tp_call*/
21114  0, /*tp_str*/
21115  __pyx_tp_getattro_array, /*tp_getattro*/
21116  0, /*tp_setattro*/
21117  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21118  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21119  0, /*tp_doc*/
21120  0, /*tp_traverse*/
21121  0, /*tp_clear*/
21122  0, /*tp_richcompare*/
21123  0, /*tp_weaklistoffset*/
21124  0, /*tp_iter*/
21125  0, /*tp_iternext*/
21126  __pyx_methods_array, /*tp_methods*/
21127  0, /*tp_members*/
21128  __pyx_getsets_array, /*tp_getset*/
21129  0, /*tp_base*/
21130  0, /*tp_dict*/
21131  0, /*tp_descr_get*/
21132  0, /*tp_descr_set*/
21133  0, /*tp_dictoffset*/
21134  0, /*tp_init*/
21135  0, /*tp_alloc*/
21136  __pyx_tp_new_array, /*tp_new*/
21137  0, /*tp_free*/
21138  0, /*tp_is_gc*/
21139  0, /*tp_bases*/
21140  0, /*tp_mro*/
21141  0, /*tp_cache*/
21142  0, /*tp_subclasses*/
21143  0, /*tp_weaklist*/
21144  0, /*tp_del*/
21145  0, /*tp_version_tag*/
21146  #if PY_VERSION_HEX >= 0x030400a1
21147  0, /*tp_finalize*/
21148  #endif
21149  #if PY_VERSION_HEX >= 0x030800b1
21150  0, /*tp_vectorcall*/
21151  #endif
21152  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21153  0, /*tp_print*/
21154  #endif
21155 };
21156 
21157 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21158  struct __pyx_MemviewEnum_obj *p;
21159  PyObject *o;
21160  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21161  o = (*t->tp_alloc)(t, 0);
21162  } else {
21163  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21164  }
21165  if (unlikely(!o)) return 0;
21166  p = ((struct __pyx_MemviewEnum_obj *)o);
21167  p->name = Py_None; Py_INCREF(Py_None);
21168  return o;
21169 }
21170 
21171 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21172  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21173  #if CYTHON_USE_TP_FINALIZE
21174  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21175  if (PyObject_CallFinalizerFromDealloc(o)) return;
21176  }
21177  #endif
21178  PyObject_GC_UnTrack(o);
21179  Py_CLEAR(p->name);
21180  (*Py_TYPE(o)->tp_free)(o);
21181 }
21182 
21183 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21184  int e;
21185  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21186  if (p->name) {
21187  e = (*v)(p->name, a); if (e) return e;
21188  }
21189  return 0;
21190 }
21191 
21192 static int __pyx_tp_clear_Enum(PyObject *o) {
21193  PyObject* tmp;
21194  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21195  tmp = ((PyObject*)p->name);
21196  p->name = Py_None; Py_INCREF(Py_None);
21197  Py_XDECREF(tmp);
21198  return 0;
21199 }
21200 
21201 static PyMethodDef __pyx_methods_Enum[] = {
21202  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21203  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21204  {0, 0, 0, 0}
21205 };
21206 
21207 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21208  PyVarObject_HEAD_INIT(0, 0)
21209  "imate._c_linear_operator.py_c_matrix.Enum", /*tp_name*/
21210  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21211  0, /*tp_itemsize*/
21212  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21213  #if PY_VERSION_HEX < 0x030800b4
21214  0, /*tp_print*/
21215  #endif
21216  #if PY_VERSION_HEX >= 0x030800b4
21217  0, /*tp_vectorcall_offset*/
21218  #endif
21219  0, /*tp_getattr*/
21220  0, /*tp_setattr*/
21221  #if PY_MAJOR_VERSION < 3
21222  0, /*tp_compare*/
21223  #endif
21224  #if PY_MAJOR_VERSION >= 3
21225  0, /*tp_as_async*/
21226  #endif
21227  __pyx_MemviewEnum___repr__, /*tp_repr*/
21228  0, /*tp_as_number*/
21229  0, /*tp_as_sequence*/
21230  0, /*tp_as_mapping*/
21231  0, /*tp_hash*/
21232  0, /*tp_call*/
21233  0, /*tp_str*/
21234  0, /*tp_getattro*/
21235  0, /*tp_setattro*/
21236  0, /*tp_as_buffer*/
21237  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21238  0, /*tp_doc*/
21239  __pyx_tp_traverse_Enum, /*tp_traverse*/
21240  __pyx_tp_clear_Enum, /*tp_clear*/
21241  0, /*tp_richcompare*/
21242  0, /*tp_weaklistoffset*/
21243  0, /*tp_iter*/
21244  0, /*tp_iternext*/
21245  __pyx_methods_Enum, /*tp_methods*/
21246  0, /*tp_members*/
21247  0, /*tp_getset*/
21248  0, /*tp_base*/
21249  0, /*tp_dict*/
21250  0, /*tp_descr_get*/
21251  0, /*tp_descr_set*/
21252  0, /*tp_dictoffset*/
21253  __pyx_MemviewEnum___init__, /*tp_init*/
21254  0, /*tp_alloc*/
21255  __pyx_tp_new_Enum, /*tp_new*/
21256  0, /*tp_free*/
21257  0, /*tp_is_gc*/
21258  0, /*tp_bases*/
21259  0, /*tp_mro*/
21260  0, /*tp_cache*/
21261  0, /*tp_subclasses*/
21262  0, /*tp_weaklist*/
21263  0, /*tp_del*/
21264  0, /*tp_version_tag*/
21265  #if PY_VERSION_HEX >= 0x030400a1
21266  0, /*tp_finalize*/
21267  #endif
21268  #if PY_VERSION_HEX >= 0x030800b1
21269  0, /*tp_vectorcall*/
21270  #endif
21271  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21272  0, /*tp_print*/
21273  #endif
21274 };
21275 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21276 
21277 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21278  struct __pyx_memoryview_obj *p;
21279  PyObject *o;
21280  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21281  o = (*t->tp_alloc)(t, 0);
21282  } else {
21283  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21284  }
21285  if (unlikely(!o)) return 0;
21286  p = ((struct __pyx_memoryview_obj *)o);
21287  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21288  p->obj = Py_None; Py_INCREF(Py_None);
21289  p->_size = Py_None; Py_INCREF(Py_None);
21290  p->_array_interface = Py_None; Py_INCREF(Py_None);
21291  p->view.obj = NULL;
21292  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21293  return o;
21294  bad:
21295  Py_DECREF(o); o = 0;
21296  return NULL;
21297 }
21298 
21299 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21300  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21301  #if CYTHON_USE_TP_FINALIZE
21302  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21303  if (PyObject_CallFinalizerFromDealloc(o)) return;
21304  }
21305  #endif
21306  PyObject_GC_UnTrack(o);
21307  {
21308  PyObject *etype, *eval, *etb;
21309  PyErr_Fetch(&etype, &eval, &etb);
21310  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21311  __pyx_memoryview___dealloc__(o);
21312  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21313  PyErr_Restore(etype, eval, etb);
21314  }
21315  Py_CLEAR(p->obj);
21316  Py_CLEAR(p->_size);
21317  Py_CLEAR(p->_array_interface);
21318  (*Py_TYPE(o)->tp_free)(o);
21319 }
21320 
21321 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21322  int e;
21323  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21324  if (p->obj) {
21325  e = (*v)(p->obj, a); if (e) return e;
21326  }
21327  if (p->_size) {
21328  e = (*v)(p->_size, a); if (e) return e;
21329  }
21330  if (p->_array_interface) {
21331  e = (*v)(p->_array_interface, a); if (e) return e;
21332  }
21333  if (p->view.obj) {
21334  e = (*v)(p->view.obj, a); if (e) return e;
21335  }
21336  return 0;
21337 }
21338 
21339 static int __pyx_tp_clear_memoryview(PyObject *o) {
21340  PyObject* tmp;
21341  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21342  tmp = ((PyObject*)p->obj);
21343  p->obj = Py_None; Py_INCREF(Py_None);
21344  Py_XDECREF(tmp);
21345  tmp = ((PyObject*)p->_size);
21346  p->_size = Py_None; Py_INCREF(Py_None);
21347  Py_XDECREF(tmp);
21348  tmp = ((PyObject*)p->_array_interface);
21349  p->_array_interface = Py_None; Py_INCREF(Py_None);
21350  Py_XDECREF(tmp);
21351  Py_CLEAR(p->view.obj);
21352  return 0;
21353 }
21354 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21355  PyObject *r;
21356  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21357  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21358  Py_DECREF(x);
21359  return r;
21360 }
21361 
21362 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21363  if (v) {
21364  return __pyx_memoryview___setitem__(o, i, v);
21365  }
21366  else {
21367  PyErr_Format(PyExc_NotImplementedError,
21368  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21369  return -1;
21370  }
21371 }
21372 
21373 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21374  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21375 }
21376 
21377 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21378  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21379 }
21380 
21381 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21382  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21383 }
21384 
21385 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21386  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21387 }
21388 
21389 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21390  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21391 }
21392 
21393 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21394  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21395 }
21396 
21397 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21398  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21399 }
21400 
21401 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21402  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21403 }
21404 
21405 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21406  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21407 }
21408 
21409 static PyMethodDef __pyx_methods_memoryview[] = {
21410  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21411  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21412  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21413  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21414  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21415  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21416  {0, 0, 0, 0}
21417 };
21418 
21419 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21420  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21421  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21422  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21423  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21424  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21425  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21426  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21427  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21428  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21429  {0, 0, 0, 0, 0}
21430 };
21431 
21432 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21433  __pyx_memoryview___len__, /*sq_length*/
21434  0, /*sq_concat*/
21435  0, /*sq_repeat*/
21436  __pyx_sq_item_memoryview, /*sq_item*/
21437  0, /*sq_slice*/
21438  0, /*sq_ass_item*/
21439  0, /*sq_ass_slice*/
21440  0, /*sq_contains*/
21441  0, /*sq_inplace_concat*/
21442  0, /*sq_inplace_repeat*/
21443 };
21444 
21445 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21446  __pyx_memoryview___len__, /*mp_length*/
21447  __pyx_memoryview___getitem__, /*mp_subscript*/
21448  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21449 };
21450 
21451 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21452  #if PY_MAJOR_VERSION < 3
21453  0, /*bf_getreadbuffer*/
21454  #endif
21455  #if PY_MAJOR_VERSION < 3
21456  0, /*bf_getwritebuffer*/
21457  #endif
21458  #if PY_MAJOR_VERSION < 3
21459  0, /*bf_getsegcount*/
21460  #endif
21461  #if PY_MAJOR_VERSION < 3
21462  0, /*bf_getcharbuffer*/
21463  #endif
21464  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21465  0, /*bf_releasebuffer*/
21466 };
21467 
21468 static PyTypeObject __pyx_type___pyx_memoryview = {
21469  PyVarObject_HEAD_INIT(0, 0)
21470  "imate._c_linear_operator.py_c_matrix.memoryview", /*tp_name*/
21471  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21472  0, /*tp_itemsize*/
21473  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21474  #if PY_VERSION_HEX < 0x030800b4
21475  0, /*tp_print*/
21476  #endif
21477  #if PY_VERSION_HEX >= 0x030800b4
21478  0, /*tp_vectorcall_offset*/
21479  #endif
21480  0, /*tp_getattr*/
21481  0, /*tp_setattr*/
21482  #if PY_MAJOR_VERSION < 3
21483  0, /*tp_compare*/
21484  #endif
21485  #if PY_MAJOR_VERSION >= 3
21486  0, /*tp_as_async*/
21487  #endif
21488  __pyx_memoryview___repr__, /*tp_repr*/
21489  0, /*tp_as_number*/
21490  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21491  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21492  0, /*tp_hash*/
21493  0, /*tp_call*/
21494  __pyx_memoryview___str__, /*tp_str*/
21495  0, /*tp_getattro*/
21496  0, /*tp_setattro*/
21497  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21498  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21499  0, /*tp_doc*/
21500  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21501  __pyx_tp_clear_memoryview, /*tp_clear*/
21502  0, /*tp_richcompare*/
21503  0, /*tp_weaklistoffset*/
21504  0, /*tp_iter*/
21505  0, /*tp_iternext*/
21506  __pyx_methods_memoryview, /*tp_methods*/
21507  0, /*tp_members*/
21508  __pyx_getsets_memoryview, /*tp_getset*/
21509  0, /*tp_base*/
21510  0, /*tp_dict*/
21511  0, /*tp_descr_get*/
21512  0, /*tp_descr_set*/
21513  0, /*tp_dictoffset*/
21514  0, /*tp_init*/
21515  0, /*tp_alloc*/
21516  __pyx_tp_new_memoryview, /*tp_new*/
21517  0, /*tp_free*/
21518  0, /*tp_is_gc*/
21519  0, /*tp_bases*/
21520  0, /*tp_mro*/
21521  0, /*tp_cache*/
21522  0, /*tp_subclasses*/
21523  0, /*tp_weaklist*/
21524  0, /*tp_del*/
21525  0, /*tp_version_tag*/
21526  #if PY_VERSION_HEX >= 0x030400a1
21527  0, /*tp_finalize*/
21528  #endif
21529  #if PY_VERSION_HEX >= 0x030800b1
21530  0, /*tp_vectorcall*/
21531  #endif
21532  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21533  0, /*tp_print*/
21534  #endif
21535 };
21536 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21537 
21538 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21539  struct __pyx_memoryviewslice_obj *p;
21540  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21541  if (unlikely(!o)) return 0;
21542  p = ((struct __pyx_memoryviewslice_obj *)o);
21543  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21544  p->from_object = Py_None; Py_INCREF(Py_None);
21545  p->from_slice.memview = NULL;
21546  return o;
21547 }
21548 
21549 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21550  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21551  #if CYTHON_USE_TP_FINALIZE
21552  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21553  if (PyObject_CallFinalizerFromDealloc(o)) return;
21554  }
21555  #endif
21556  PyObject_GC_UnTrack(o);
21557  {
21558  PyObject *etype, *eval, *etb;
21559  PyErr_Fetch(&etype, &eval, &etb);
21560  __Pyx_SET_REFCNT(o, Py_REFCNT(o) + 1);
21561  __pyx_memoryviewslice___dealloc__(o);
21562  __Pyx_SET_REFCNT(o, Py_REFCNT(o) - 1);
21563  PyErr_Restore(etype, eval, etb);
21564  }
21565  Py_CLEAR(p->from_object);
21566  PyObject_GC_Track(o);
21567  __pyx_tp_dealloc_memoryview(o);
21568 }
21569 
21570 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21571  int e;
21572  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21573  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21574  if (p->from_object) {
21575  e = (*v)(p->from_object, a); if (e) return e;
21576  }
21577  return 0;
21578 }
21579 
21580 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21581  PyObject* tmp;
21582  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21583  __pyx_tp_clear_memoryview(o);
21584  tmp = ((PyObject*)p->from_object);
21585  p->from_object = Py_None; Py_INCREF(Py_None);
21586  Py_XDECREF(tmp);
21587  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21588  return 0;
21589 }
21590 
21591 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21592  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21593 }
21594 
21595 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21596  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21597  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21598  {0, 0, 0, 0}
21599 };
21600 
21601 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21602  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21603  {0, 0, 0, 0, 0}
21604 };
21605 
21606 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21607  PyVarObject_HEAD_INIT(0, 0)
21608  "imate._c_linear_operator.py_c_matrix._memoryviewslice", /*tp_name*/
21609  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21610  0, /*tp_itemsize*/
21611  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21612  #if PY_VERSION_HEX < 0x030800b4
21613  0, /*tp_print*/
21614  #endif
21615  #if PY_VERSION_HEX >= 0x030800b4
21616  0, /*tp_vectorcall_offset*/
21617  #endif
21618  0, /*tp_getattr*/
21619  0, /*tp_setattr*/
21620  #if PY_MAJOR_VERSION < 3
21621  0, /*tp_compare*/
21622  #endif
21623  #if PY_MAJOR_VERSION >= 3
21624  0, /*tp_as_async*/
21625  #endif
21626  #if CYTHON_COMPILING_IN_PYPY
21627  __pyx_memoryview___repr__, /*tp_repr*/
21628  #else
21629  0, /*tp_repr*/
21630  #endif
21631  0, /*tp_as_number*/
21632  0, /*tp_as_sequence*/
21633  0, /*tp_as_mapping*/
21634  0, /*tp_hash*/
21635  0, /*tp_call*/
21636  #if CYTHON_COMPILING_IN_PYPY
21637  __pyx_memoryview___str__, /*tp_str*/
21638  #else
21639  0, /*tp_str*/
21640  #endif
21641  0, /*tp_getattro*/
21642  0, /*tp_setattro*/
21643  0, /*tp_as_buffer*/
21644  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21645  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21646  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21647  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21648  0, /*tp_richcompare*/
21649  0, /*tp_weaklistoffset*/
21650  0, /*tp_iter*/
21651  0, /*tp_iternext*/
21652  __pyx_methods__memoryviewslice, /*tp_methods*/
21653  0, /*tp_members*/
21654  __pyx_getsets__memoryviewslice, /*tp_getset*/
21655  0, /*tp_base*/
21656  0, /*tp_dict*/
21657  0, /*tp_descr_get*/
21658  0, /*tp_descr_set*/
21659  0, /*tp_dictoffset*/
21660  0, /*tp_init*/
21661  0, /*tp_alloc*/
21662  __pyx_tp_new__memoryviewslice, /*tp_new*/
21663  0, /*tp_free*/
21664  0, /*tp_is_gc*/
21665  0, /*tp_bases*/
21666  0, /*tp_mro*/
21667  0, /*tp_cache*/
21668  0, /*tp_subclasses*/
21669  0, /*tp_weaklist*/
21670  0, /*tp_del*/
21671  0, /*tp_version_tag*/
21672  #if PY_VERSION_HEX >= 0x030400a1
21673  0, /*tp_finalize*/
21674  #endif
21675  #if PY_VERSION_HEX >= 0x030800b1
21676  0, /*tp_vectorcall*/
21677  #endif
21678  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
21679  0, /*tp_print*/
21680  #endif
21681 };
21682 
21683 static PyMethodDef __pyx_methods[] = {
21684  {0, 0, 0, 0}
21685 };
21686 
21687 #if PY_MAJOR_VERSION >= 3
21688 #if CYTHON_PEP489_MULTI_PHASE_INIT
21689 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
21690 static int __pyx_pymod_exec_py_c_matrix(PyObject* module); /*proto*/
21691 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
21692  {Py_mod_create, (void*)__pyx_pymod_create},
21693  {Py_mod_exec, (void*)__pyx_pymod_exec_py_c_matrix},
21694  {0, NULL}
21695 };
21696 #endif
21697 
21698 static struct PyModuleDef __pyx_moduledef = {
21699  PyModuleDef_HEAD_INIT,
21700  "py_c_matrix",
21701  0, /* m_doc */
21702  #if CYTHON_PEP489_MULTI_PHASE_INIT
21703  0, /* m_size */
21704  #else
21705  -1, /* m_size */
21706  #endif
21707  __pyx_methods /* m_methods */,
21708  #if CYTHON_PEP489_MULTI_PHASE_INIT
21709  __pyx_moduledef_slots, /* m_slots */
21710  #else
21711  NULL, /* m_reload */
21712  #endif
21713  NULL, /* m_traverse */
21714  NULL, /* m_clear */
21715  NULL /* m_free */
21716 };
21717 #endif
21718 #ifndef CYTHON_SMALL_CODE
21719 #if defined(__clang__)
21720  #define CYTHON_SMALL_CODE
21721 #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
21722  #define CYTHON_SMALL_CODE __attribute__((cold))
21723 #else
21724  #define CYTHON_SMALL_CODE
21725 #endif
21726 #endif
21727 
21728 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21729  {&__pyx_n_s_A, __pyx_k_A, sizeof(__pyx_k_A), 0, 0, 1, 1},
21730  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
21731  {&__pyx_kp_u_A_cannot_be_None, __pyx_k_A_cannot_be_None, sizeof(__pyx_k_A_cannot_be_None), 0, 1, 0, 0},
21732  {&__pyx_n_s_A_data_double, __pyx_k_A_data_double, sizeof(__pyx_k_A_data_double), 0, 0, 1, 1},
21733  {&__pyx_n_s_A_data_double_mv, __pyx_k_A_data_double_mv, sizeof(__pyx_k_A_data_double_mv), 0, 0, 1, 1},
21734  {&__pyx_n_s_A_data_double_mv_c, __pyx_k_A_data_double_mv_c, sizeof(__pyx_k_A_data_double_mv_c), 0, 0, 1, 1},
21735  {&__pyx_n_s_A_data_double_mv_f, __pyx_k_A_data_double_mv_f, sizeof(__pyx_k_A_data_double_mv_f), 0, 0, 1, 1},
21736  {&__pyx_n_s_A_data_float, __pyx_k_A_data_float, sizeof(__pyx_k_A_data_float), 0, 0, 1, 1},
21737  {&__pyx_n_s_A_data_float_mv, __pyx_k_A_data_float_mv, sizeof(__pyx_k_A_data_float_mv), 0, 0, 1, 1},
21738  {&__pyx_n_s_A_data_float_mv_c, __pyx_k_A_data_float_mv_c, sizeof(__pyx_k_A_data_float_mv_c), 0, 0, 1, 1},
21739  {&__pyx_n_s_A_data_float_mv_f, __pyx_k_A_data_float_mv_f, sizeof(__pyx_k_A_data_float_mv_f), 0, 0, 1, 1},
21740  {&__pyx_n_s_A_data_long_double, __pyx_k_A_data_long_double, sizeof(__pyx_k_A_data_long_double), 0, 0, 1, 1},
21741  {&__pyx_n_s_A_data_long_double_mv, __pyx_k_A_data_long_double_mv, sizeof(__pyx_k_A_data_long_double_mv), 0, 0, 1, 1},
21742  {&__pyx_n_s_A_data_long_double_mv_c, __pyx_k_A_data_long_double_mv_c, sizeof(__pyx_k_A_data_long_double_mv_c), 0, 0, 1, 1},
21743  {&__pyx_n_s_A_data_long_double_mv_f, __pyx_k_A_data_long_double_mv_f, sizeof(__pyx_k_A_data_long_double_mv_f), 0, 0, 1, 1},
21744  {&__pyx_n_s_A_index_pointer, __pyx_k_A_index_pointer, sizeof(__pyx_k_A_index_pointer), 0, 0, 1, 1},
21745  {&__pyx_n_s_A_index_pointer_mv, __pyx_k_A_index_pointer_mv, sizeof(__pyx_k_A_index_pointer_mv), 0, 0, 1, 1},
21746  {&__pyx_n_s_A_indices, __pyx_k_A_indices, sizeof(__pyx_k_A_indices), 0, 0, 1, 1},
21747  {&__pyx_n_s_A_indices_mv, __pyx_k_A_indices_mv, sizeof(__pyx_k_A_indices_mv), 0, 0, 1, 1},
21748  {&__pyx_n_s_A_is_row_major, __pyx_k_A_is_row_major, sizeof(__pyx_k_A_is_row_major), 0, 0, 1, 1},
21749  {&__pyx_n_s_A_num_columns, __pyx_k_A_num_columns, sizeof(__pyx_k_A_num_columns), 0, 0, 1, 1},
21750  {&__pyx_n_s_A_num_rows, __pyx_k_A_num_rows, sizeof(__pyx_k_A_num_rows), 0, 0, 1, 1},
21751  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
21752  {&__pyx_n_u_C_CONTIGUOUS, __pyx_k_C_CONTIGUOUS, sizeof(__pyx_k_C_CONTIGUOUS), 0, 1, 0, 1},
21753  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
21754  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
21755  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
21756  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
21757  {&__pyx_kp_u_Data_type_should_be_float32_floa, __pyx_k_Data_type_should_be_float32_floa, sizeof(__pyx_k_Data_type_should_be_float32_floa), 0, 1, 0, 0},
21758  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
21759  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
21760  {&__pyx_n_u_F_CONTIGUOUS, __pyx_k_F_CONTIGUOUS, sizeof(__pyx_k_F_CONTIGUOUS), 0, 1, 0, 1},
21761  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
21762  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
21763  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
21764  {&__pyx_kp_u_Input_matrix_should_be_a_2_dimen, __pyx_k_Input_matrix_should_be_a_2_dimen, sizeof(__pyx_k_Input_matrix_should_be_a_2_dimen), 0, 1, 0, 0},
21765  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
21766  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
21767  {&__pyx_kp_u_Matrix_A_should_be_either_C_or_F, __pyx_k_Matrix_A_should_be_either_C_or_F, sizeof(__pyx_k_Matrix_A_should_be_either_C_or_F), 0, 1, 0, 0},
21768  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
21769  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
21770  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
21771  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
21772  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
21773  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
21774  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
21775  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
21776  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21777  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
21778  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
21779  {&__pyx_n_s_astype, __pyx_k_astype, sizeof(__pyx_k_astype), 0, 0, 1, 1},
21780  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
21781  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
21782  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
21783  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
21784  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
21785  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
21786  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
21787  {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
21788  {&__pyx_n_s_csr_matrix, __pyx_k_csr_matrix, sizeof(__pyx_k_csr_matrix), 0, 0, 1, 1},
21789  {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
21790  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
21791  {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
21792  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
21793  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
21794  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
21795  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
21796  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
21797  {&__pyx_n_b_float128, __pyx_k_float128, sizeof(__pyx_k_float128), 0, 0, 0, 1},
21798  {&__pyx_n_b_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 0, 1},
21799  {&__pyx_n_b_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 0, 1},
21800  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
21801  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
21802  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
21803  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
21804  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
21805  {&__pyx_n_s_has_sorted_indices, __pyx_k_has_sorted_indices, sizeof(__pyx_k_has_sorted_indices), 0, 0, 1, 1},
21806  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
21807  {&__pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_k_imate__c_linear_operator_py_c_ma, sizeof(__pyx_k_imate__c_linear_operator_py_c_ma), 0, 0, 1, 0},
21808  {&__pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_k_imate__c_linear_operator_py_c_ma_2, sizeof(__pyx_k_imate__c_linear_operator_py_c_ma_2), 0, 0, 1, 1},
21809  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
21810  {&__pyx_n_s_indices, __pyx_k_indices, sizeof(__pyx_k_indices), 0, 0, 1, 1},
21811  {&__pyx_n_s_indptr, __pyx_k_indptr, sizeof(__pyx_k_indptr), 0, 0, 1, 1},
21812  {&__pyx_n_s_issparse, __pyx_k_issparse, sizeof(__pyx_k_issparse), 0, 0, 1, 1},
21813  {&__pyx_n_s_isspmatrix_csc, __pyx_k_isspmatrix_csc, sizeof(__pyx_k_isspmatrix_csc), 0, 0, 1, 1},
21814  {&__pyx_n_s_isspmatrix_csr, __pyx_k_isspmatrix_csr, sizeof(__pyx_k_isspmatrix_csr), 0, 0, 1, 1},
21815  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
21816  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
21817  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
21818  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
21819  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
21820  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
21821  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
21822  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
21823  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
21824  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
21825  {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
21826  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
21827  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
21828  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
21829  {&__pyx_n_s_pycMatrix, __pyx_k_pycMatrix, sizeof(__pyx_k_pycMatrix), 0, 0, 1, 1},
21830  {&__pyx_n_s_pycMatrix___reduce_cython, __pyx_k_pycMatrix___reduce_cython, sizeof(__pyx_k_pycMatrix___reduce_cython), 0, 0, 1, 1},
21831  {&__pyx_n_s_pycMatrix___setstate_cython, __pyx_k_pycMatrix___setstate_cython, sizeof(__pyx_k_pycMatrix___setstate_cython), 0, 0, 1, 1},
21832  {&__pyx_n_s_pycMatrix_set_csc_matrix_double, __pyx_k_pycMatrix_set_csc_matrix_double, sizeof(__pyx_k_pycMatrix_set_csc_matrix_double), 0, 0, 1, 1},
21833  {&__pyx_n_s_pycMatrix_set_csc_matrix_float, __pyx_k_pycMatrix_set_csc_matrix_float, sizeof(__pyx_k_pycMatrix_set_csc_matrix_float), 0, 0, 1, 1},
21834  {&__pyx_n_s_pycMatrix_set_csc_matrix_long_do, __pyx_k_pycMatrix_set_csc_matrix_long_do, sizeof(__pyx_k_pycMatrix_set_csc_matrix_long_do), 0, 0, 1, 1},
21835  {&__pyx_n_s_pycMatrix_set_csr_matrix_double, __pyx_k_pycMatrix_set_csr_matrix_double, sizeof(__pyx_k_pycMatrix_set_csr_matrix_double), 0, 0, 1, 1},
21836  {&__pyx_n_s_pycMatrix_set_csr_matrix_float, __pyx_k_pycMatrix_set_csr_matrix_float, sizeof(__pyx_k_pycMatrix_set_csr_matrix_float), 0, 0, 1, 1},
21837  {&__pyx_n_s_pycMatrix_set_csr_matrix_long_do, __pyx_k_pycMatrix_set_csr_matrix_long_do, sizeof(__pyx_k_pycMatrix_set_csr_matrix_long_do), 0, 0, 1, 1},
21838  {&__pyx_n_s_pycMatrix_set_dense_matrix_doubl, __pyx_k_pycMatrix_set_dense_matrix_doubl, sizeof(__pyx_k_pycMatrix_set_dense_matrix_doubl), 0, 0, 1, 1},
21839  {&__pyx_n_s_pycMatrix_set_dense_matrix_float, __pyx_k_pycMatrix_set_dense_matrix_float, sizeof(__pyx_k_pycMatrix_set_dense_matrix_float), 0, 0, 1, 1},
21840  {&__pyx_n_s_pycMatrix_set_dense_matrix_long, __pyx_k_pycMatrix_set_dense_matrix_long, sizeof(__pyx_k_pycMatrix_set_dense_matrix_long), 0, 0, 1, 1},
21841  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
21842  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
21843  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
21844  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
21845  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
21846  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
21847  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
21848  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
21849  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
21850  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
21851  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
21852  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
21853  {&__pyx_n_s_scipy_sparse, __pyx_k_scipy_sparse, sizeof(__pyx_k_scipy_sparse), 0, 0, 1, 1},
21854  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
21855  {&__pyx_n_s_set_csc_matrix_double, __pyx_k_set_csc_matrix_double, sizeof(__pyx_k_set_csc_matrix_double), 0, 0, 1, 1},
21856  {&__pyx_n_s_set_csc_matrix_float, __pyx_k_set_csc_matrix_float, sizeof(__pyx_k_set_csc_matrix_float), 0, 0, 1, 1},
21857  {&__pyx_n_s_set_csc_matrix_long_double, __pyx_k_set_csc_matrix_long_double, sizeof(__pyx_k_set_csc_matrix_long_double), 0, 0, 1, 1},
21858  {&__pyx_n_s_set_csr_matrix_double, __pyx_k_set_csr_matrix_double, sizeof(__pyx_k_set_csr_matrix_double), 0, 0, 1, 1},
21859  {&__pyx_n_s_set_csr_matrix_float, __pyx_k_set_csr_matrix_float, sizeof(__pyx_k_set_csr_matrix_float), 0, 0, 1, 1},
21860  {&__pyx_n_s_set_csr_matrix_long_double, __pyx_k_set_csr_matrix_long_double, sizeof(__pyx_k_set_csr_matrix_long_double), 0, 0, 1, 1},
21861  {&__pyx_n_s_set_dense_matrix_double, __pyx_k_set_dense_matrix_double, sizeof(__pyx_k_set_dense_matrix_double), 0, 0, 1, 1},
21862  {&__pyx_n_s_set_dense_matrix_float, __pyx_k_set_dense_matrix_float, sizeof(__pyx_k_set_dense_matrix_float), 0, 0, 1, 1},
21863  {&__pyx_n_s_set_dense_matrix_long_double, __pyx_k_set_dense_matrix_long_double, sizeof(__pyx_k_set_dense_matrix_long_double), 0, 0, 1, 1},
21864  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
21865  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
21866  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
21867  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
21868  {&__pyx_n_s_sort_indices, __pyx_k_sort_indices, sizeof(__pyx_k_sort_indices), 0, 0, 1, 1},
21869  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
21870  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
21871  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
21872  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
21873  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
21874  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
21875  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
21876  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
21877  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
21878  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
21879  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
21880  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
21881  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
21882  {0, 0, 0, 0, 0, 0, 0}
21883 };
21884 static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
21885  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 126, __pyx_L1_error)
21886  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 142, __pyx_L1_error)
21887  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(1, 148, __pyx_L1_error)
21888  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(1, 151, __pyx_L1_error)
21889  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(1, 180, __pyx_L1_error)
21890  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(1, 404, __pyx_L1_error)
21891  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(1, 613, __pyx_L1_error)
21892  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 832, __pyx_L1_error)
21893  return 0;
21894  __pyx_L1_error:;
21895  return -1;
21896 }
21897 
21898 static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
21899  __Pyx_RefNannyDeclarations
21900  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
21901 
21902  /* "imate/_c_linear_operator/py_c_matrix.pyx":126
21903  * # Check A
21904  * if A is None:
21905  * raise ValueError('A cannot be None.') # <<<<<<<<<<<<<<
21906  *
21907  * if A.ndim != 2:
21908  */
21909  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_A_cannot_be_None); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 126, __pyx_L1_error)
21910  __Pyx_GOTREF(__pyx_tuple_);
21911  __Pyx_GIVEREF(__pyx_tuple_);
21912 
21913  /* "imate/_c_linear_operator/py_c_matrix.pyx":129
21914  *
21915  * if A.ndim != 2:
21916  * raise ValueError('Input matrix should be a 2-dimensional array.') # <<<<<<<<<<<<<<
21917  *
21918  * # Data type
21919  */
21920  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_u_Input_matrix_should_be_a_2_dimen); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 129, __pyx_L1_error)
21921  __Pyx_GOTREF(__pyx_tuple__2);
21922  __Pyx_GIVEREF(__pyx_tuple__2);
21923 
21924  /* "imate/_c_linear_operator/py_c_matrix.pyx":142
21925  *
21926  * else:
21927  * raise TypeError('Data type should be "float32", "float64", or ' + # <<<<<<<<<<<<<<
21928  * '"float128".')
21929  *
21930  */
21931  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_Data_type_should_be_float32_floa); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 142, __pyx_L1_error)
21932  __Pyx_GOTREF(__pyx_tuple__3);
21933  __Pyx_GIVEREF(__pyx_tuple__3);
21934 
21935  /* "imate/_c_linear_operator/py_c_matrix.pyx":235
21936  * A_is_row_major = 0
21937  * else:
21938  * raise TypeError('Matrix A should be either C or F contiguous.') # <<<<<<<<<<<<<<
21939  *
21940  * # Declare memoryviews to get data pointer
21941  */
21942  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Matrix_A_should_be_either_C_or_F); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 235, __pyx_L1_error)
21943  __Pyx_GOTREF(__pyx_tuple__5);
21944  __Pyx_GIVEREF(__pyx_tuple__5);
21945 
21946  /* "(tree fragment)":2
21947  * def __reduce_cython__(self):
21948  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21949  * def __setstate_cython__(self, __pyx_state):
21950  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21951  */
21952  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 2, __pyx_L1_error)
21953  __Pyx_GOTREF(__pyx_tuple__15);
21954  __Pyx_GIVEREF(__pyx_tuple__15);
21955 
21956  /* "(tree fragment)":4
21957  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
21958  * def __setstate_cython__(self, __pyx_state):
21959  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
21960  */
21961  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 4, __pyx_L1_error)
21962  __Pyx_GOTREF(__pyx_tuple__17);
21963  __Pyx_GIVEREF(__pyx_tuple__17);
21964 
21965  /* "View.MemoryView":133
21966  *
21967  * if not self.ndim:
21968  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
21969  *
21970  * if itemsize <= 0:
21971  */
21972  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 133, __pyx_L1_error)
21973  __Pyx_GOTREF(__pyx_tuple__18);
21974  __Pyx_GIVEREF(__pyx_tuple__18);
21975 
21976  /* "View.MemoryView":136
21977  *
21978  * if itemsize <= 0:
21979  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
21980  *
21981  * if not isinstance(format, bytes):
21982  */
21983  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 136, __pyx_L1_error)
21984  __Pyx_GOTREF(__pyx_tuple__19);
21985  __Pyx_GIVEREF(__pyx_tuple__19);
21986 
21987  /* "View.MemoryView":148
21988  *
21989  * if not self._shape:
21990  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
21991  *
21992  *
21993  */
21994  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 148, __pyx_L1_error)
21995  __Pyx_GOTREF(__pyx_tuple__20);
21996  __Pyx_GIVEREF(__pyx_tuple__20);
21997 
21998  /* "View.MemoryView":176
21999  * self.data = <char *>malloc(self.len)
22000  * if not self.data:
22001  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22002  *
22003  * if self.dtype_is_object:
22004  */
22005  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 176, __pyx_L1_error)
22006  __Pyx_GOTREF(__pyx_tuple__21);
22007  __Pyx_GIVEREF(__pyx_tuple__21);
22008 
22009  /* "View.MemoryView":192
22010  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22011  * if not (flags & bufmode):
22012  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22013  * info.buf = self.data
22014  * info.len = self.len
22015  */
22016  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 192, __pyx_L1_error)
22017  __Pyx_GOTREF(__pyx_tuple__22);
22018  __Pyx_GIVEREF(__pyx_tuple__22);
22019 
22020  /* "(tree fragment)":2
22021  * def __reduce_cython__(self):
22022  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22023  * def __setstate_cython__(self, __pyx_state):
22024  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22025  */
22026  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 2, __pyx_L1_error)
22027  __Pyx_GOTREF(__pyx_tuple__23);
22028  __Pyx_GIVEREF(__pyx_tuple__23);
22029 
22030  /* "(tree fragment)":4
22031  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22032  * def __setstate_cython__(self, __pyx_state):
22033  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22034  */
22035  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 4, __pyx_L1_error)
22036  __Pyx_GOTREF(__pyx_tuple__24);
22037  __Pyx_GIVEREF(__pyx_tuple__24);
22038 
22039  /* "View.MemoryView":418
22040  * def __setitem__(memoryview self, object index, object value):
22041  * if self.view.readonly:
22042  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22043  *
22044  * have_slices, index = _unellipsify(index, self.view.ndim)
22045  */
22046  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 418, __pyx_L1_error)
22047  __Pyx_GOTREF(__pyx_tuple__25);
22048  __Pyx_GIVEREF(__pyx_tuple__25);
22049 
22050  /* "View.MemoryView":495
22051  * result = struct.unpack(self.view.format, bytesitem)
22052  * except struct.error:
22053  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22054  * else:
22055  * if len(self.view.format) == 1:
22056  */
22057  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 495, __pyx_L1_error)
22058  __Pyx_GOTREF(__pyx_tuple__26);
22059  __Pyx_GIVEREF(__pyx_tuple__26);
22060 
22061  /* "View.MemoryView":520
22062  * def __getbuffer__(self, Py_buffer *info, int flags):
22063  * if flags & PyBUF_WRITABLE and self.view.readonly:
22064  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22065  *
22066  * if flags & PyBUF_ND:
22067  */
22068  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 520, __pyx_L1_error)
22069  __Pyx_GOTREF(__pyx_tuple__27);
22070  __Pyx_GIVEREF(__pyx_tuple__27);
22071 
22072  /* "View.MemoryView":570
22073  * if self.view.strides == NULL:
22074  *
22075  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22076  *
22077  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22078  */
22079  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 570, __pyx_L1_error)
22080  __Pyx_GOTREF(__pyx_tuple__28);
22081  __Pyx_GIVEREF(__pyx_tuple__28);
22082 
22083  /* "View.MemoryView":577
22084  * def suboffsets(self):
22085  * if self.view.suboffsets == NULL:
22086  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22087  *
22088  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22089  */
22090  __pyx_tuple__29 = PyTuple_New(1); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 577, __pyx_L1_error)
22091  __Pyx_GOTREF(__pyx_tuple__29);
22092  __Pyx_INCREF(__pyx_int_neg_1);
22093  __Pyx_GIVEREF(__pyx_int_neg_1);
22094  PyTuple_SET_ITEM(__pyx_tuple__29, 0, __pyx_int_neg_1);
22095  __Pyx_GIVEREF(__pyx_tuple__29);
22096 
22097  /* "(tree fragment)":2
22098  * def __reduce_cython__(self):
22099  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22100  * def __setstate_cython__(self, __pyx_state):
22101  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22102  */
22103  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 2, __pyx_L1_error)
22104  __Pyx_GOTREF(__pyx_tuple__30);
22105  __Pyx_GIVEREF(__pyx_tuple__30);
22106 
22107  /* "(tree fragment)":4
22108  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22109  * def __setstate_cython__(self, __pyx_state):
22110  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22111  */
22112  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 4, __pyx_L1_error)
22113  __Pyx_GOTREF(__pyx_tuple__31);
22114  __Pyx_GIVEREF(__pyx_tuple__31);
22115 
22116  /* "View.MemoryView":682
22117  * if item is Ellipsis:
22118  * if not seen_ellipsis:
22119  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22120  * seen_ellipsis = True
22121  * else:
22122  */
22123  __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(1, 682, __pyx_L1_error)
22124  __Pyx_GOTREF(__pyx_slice__32);
22125  __Pyx_GIVEREF(__pyx_slice__32);
22126 
22127  /* "View.MemoryView":703
22128  * for suboffset in suboffsets[:ndim]:
22129  * if suboffset >= 0:
22130  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22131  *
22132  *
22133  */
22134  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 703, __pyx_L1_error)
22135  __Pyx_GOTREF(__pyx_tuple__33);
22136  __Pyx_GIVEREF(__pyx_tuple__33);
22137 
22138  /* "(tree fragment)":2
22139  * def __reduce_cython__(self):
22140  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22141  * def __setstate_cython__(self, __pyx_state):
22142  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22143  */
22144  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 2, __pyx_L1_error)
22145  __Pyx_GOTREF(__pyx_tuple__34);
22146  __Pyx_GIVEREF(__pyx_tuple__34);
22147 
22148  /* "(tree fragment)":4
22149  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22150  * def __setstate_cython__(self, __pyx_state):
22151  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22152  */
22153  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 4, __pyx_L1_error)
22154  __Pyx_GOTREF(__pyx_tuple__35);
22155  __Pyx_GIVEREF(__pyx_tuple__35);
22156 
22157  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
22158  * # ======================
22159  *
22160  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
22161  * """
22162  * Sets matrix A.
22163  */
22164  __pyx_tuple__37 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_float_mv_c, __pyx_n_s_A_data_float_mv_f, __pyx_n_s_A_data_float); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 216, __pyx_L1_error)
22165  __Pyx_GOTREF(__pyx_tuple__37);
22166  __Pyx_GIVEREF(__pyx_tuple__37);
22167  __pyx_codeobj__4 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_float, 216, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__4)) __PYX_ERR(0, 216, __pyx_L1_error)
22168 
22169  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
22170  * # =======================
22171  *
22172  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
22173  * """
22174  * Sets matrix A.
22175  */
22176  __pyx_tuple__38 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_double_mv_c, __pyx_n_s_A_data_double_mv_f, __pyx_n_s_A_data_double); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(0, 272, __pyx_L1_error)
22177  __Pyx_GOTREF(__pyx_tuple__38);
22178  __Pyx_GIVEREF(__pyx_tuple__38);
22179  __pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__38, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_double, 272, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 272, __pyx_L1_error)
22180 
22181  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
22182  * # ============================
22183  *
22184  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22185  * """
22186  * Sets matrix A.
22187  */
22188  __pyx_tuple__39 = PyTuple_Pack(8, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_is_row_major, __pyx_n_s_A_data_long_double_mv_c, __pyx_n_s_A_data_long_double_mv_f, __pyx_n_s_A_data_long_double); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 328, __pyx_L1_error)
22189  __Pyx_GOTREF(__pyx_tuple__39);
22190  __Pyx_GIVEREF(__pyx_tuple__39);
22191  __pyx_codeobj__7 = (PyObject*)__Pyx_PyCode_New(2, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_dense_matrix_long_double, 328, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__7)) __PYX_ERR(0, 328, __pyx_L1_error)
22192 
22193  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
22194  * # ====================
22195  *
22196  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
22197  * """
22198  * """
22199  */
22200  __pyx_tuple__40 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(0, 384, __pyx_L1_error)
22201  __Pyx_GOTREF(__pyx_tuple__40);
22202  __Pyx_GIVEREF(__pyx_tuple__40);
22203  __pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__40, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_float, 384, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(0, 384, __pyx_L1_error)
22204 
22205  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
22206  * # =====================
22207  *
22208  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
22209  * """
22210  * """
22211  */
22212  __pyx_tuple__41 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 431, __pyx_L1_error)
22213  __Pyx_GOTREF(__pyx_tuple__41);
22214  __Pyx_GIVEREF(__pyx_tuple__41);
22215  __pyx_codeobj__9 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_double, 431, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__9)) __PYX_ERR(0, 431, __pyx_L1_error)
22216 
22217  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
22218  * # ==========================
22219  *
22220  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22221  * """
22222  * """
22223  */
22224  __pyx_tuple__42 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(0, 478, __pyx_L1_error)
22225  __Pyx_GOTREF(__pyx_tuple__42);
22226  __Pyx_GIVEREF(__pyx_tuple__42);
22227  __pyx_codeobj__10 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__42, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csr_matrix_long_double, 478, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__10)) __PYX_ERR(0, 478, __pyx_L1_error)
22228 
22229  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
22230  * # ====================
22231  *
22232  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
22233  * """
22234  * """
22235  */
22236  __pyx_tuple__43 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_float_mv, __pyx_n_s_A_data_float, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 525, __pyx_L1_error)
22237  __Pyx_GOTREF(__pyx_tuple__43);
22238  __Pyx_GIVEREF(__pyx_tuple__43);
22239  __pyx_codeobj__11 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_float, 525, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__11)) __PYX_ERR(0, 525, __pyx_L1_error)
22240 
22241  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
22242  * # =====================
22243  *
22244  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
22245  * """
22246  * """
22247  */
22248  __pyx_tuple__44 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_double_mv, __pyx_n_s_A_data_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(0, 572, __pyx_L1_error)
22249  __Pyx_GOTREF(__pyx_tuple__44);
22250  __Pyx_GIVEREF(__pyx_tuple__44);
22251  __pyx_codeobj__12 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__44, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_double, 572, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__12)) __PYX_ERR(0, 572, __pyx_L1_error)
22252 
22253  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
22254  * # ==========================
22255  *
22256  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22257  * """
22258  * """
22259  */
22260  __pyx_tuple__45 = PyTuple_Pack(10, __pyx_n_s_self, __pyx_n_s_A, __pyx_n_s_A_num_rows, __pyx_n_s_A_num_columns, __pyx_n_s_A_data_long_double_mv, __pyx_n_s_A_data_long_double, __pyx_n_s_A_indices_mv, __pyx_n_s_A_index_pointer_mv, __pyx_n_s_A_indices, __pyx_n_s_A_index_pointer); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 619, __pyx_L1_error)
22261  __Pyx_GOTREF(__pyx_tuple__45);
22262  __Pyx_GIVEREF(__pyx_tuple__45);
22263  __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(2, 0, 10, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_imate__c_linear_operator_py_c_ma, __pyx_n_s_set_csc_matrix_long_double, 619, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) __PYX_ERR(0, 619, __pyx_L1_error)
22264 
22265  /* "(tree fragment)":1
22266  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22267  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22268  * def __setstate_cython__(self, __pyx_state):
22269  */
22270  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 1, __pyx_L1_error)
22271  __Pyx_GOTREF(__pyx_tuple__46);
22272  __Pyx_GIVEREF(__pyx_tuple__46);
22273  __pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__46, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(1, 1, __pyx_L1_error)
22274 
22275  /* "(tree fragment)":3
22276  * def __reduce_cython__(self):
22277  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22278  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22279  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22280  */
22281  __pyx_tuple__47 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 3, __pyx_L1_error)
22282  __Pyx_GOTREF(__pyx_tuple__47);
22283  __Pyx_GIVEREF(__pyx_tuple__47);
22284  __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__16)) __PYX_ERR(1, 3, __pyx_L1_error)
22285 
22286  /* "View.MemoryView":286
22287  * return self.name
22288  *
22289  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22290  * cdef strided = Enum("<strided and direct>") # default
22291  * cdef indirect = Enum("<strided and indirect>")
22292  */
22293  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 286, __pyx_L1_error)
22294  __Pyx_GOTREF(__pyx_tuple__48);
22295  __Pyx_GIVEREF(__pyx_tuple__48);
22296 
22297  /* "View.MemoryView":287
22298  *
22299  * cdef generic = Enum("<strided and direct or indirect>")
22300  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22301  * cdef indirect = Enum("<strided and indirect>")
22302  *
22303  */
22304  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 287, __pyx_L1_error)
22305  __Pyx_GOTREF(__pyx_tuple__49);
22306  __Pyx_GIVEREF(__pyx_tuple__49);
22307 
22308  /* "View.MemoryView":288
22309  * cdef generic = Enum("<strided and direct or indirect>")
22310  * cdef strided = Enum("<strided and direct>") # default
22311  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22312  *
22313  *
22314  */
22315  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 288, __pyx_L1_error)
22316  __Pyx_GOTREF(__pyx_tuple__50);
22317  __Pyx_GIVEREF(__pyx_tuple__50);
22318 
22319  /* "View.MemoryView":291
22320  *
22321  *
22322  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22323  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22324  *
22325  */
22326  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 291, __pyx_L1_error)
22327  __Pyx_GOTREF(__pyx_tuple__51);
22328  __Pyx_GIVEREF(__pyx_tuple__51);
22329 
22330  /* "View.MemoryView":292
22331  *
22332  * cdef contiguous = Enum("<contiguous and direct>")
22333  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22334  *
22335  *
22336  */
22337  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 292, __pyx_L1_error)
22338  __Pyx_GOTREF(__pyx_tuple__52);
22339  __Pyx_GIVEREF(__pyx_tuple__52);
22340 
22341  /* "(tree fragment)":1
22342  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22343  * cdef object __pyx_PickleError
22344  * cdef object __pyx_result
22345  */
22346  __pyx_tuple__53 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 1, __pyx_L1_error)
22347  __Pyx_GOTREF(__pyx_tuple__53);
22348  __Pyx_GIVEREF(__pyx_tuple__53);
22349  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(1, 1, __pyx_L1_error)
22350  __Pyx_RefNannyFinishContext();
22351  return 0;
22352  __pyx_L1_error:;
22353  __Pyx_RefNannyFinishContext();
22354  return -1;
22355 }
22356 
22357 static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
22358  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22359  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
22360  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22361  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22362  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
22363  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22364  return 0;
22365  __pyx_L1_error:;
22366  return -1;
22367 }
22368 
22369 static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
22370 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
22371 static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
22372 static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
22373 static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
22374 static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
22375 static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/
22376 
22377 static int __Pyx_modinit_global_init_code(void) {
22378  __Pyx_RefNannyDeclarations
22379  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22380  /*--- Global init code ---*/
22381  generic = Py_None; Py_INCREF(Py_None);
22382  strided = Py_None; Py_INCREF(Py_None);
22383  indirect = Py_None; Py_INCREF(Py_None);
22384  contiguous = Py_None; Py_INCREF(Py_None);
22385  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22386  __Pyx_RefNannyFinishContext();
22387  return 0;
22388 }
22389 
22390 static int __Pyx_modinit_variable_export_code(void) {
22391  __Pyx_RefNannyDeclarations
22392  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22393  /*--- Variable export code ---*/
22394  __Pyx_RefNannyFinishContext();
22395  return 0;
22396 }
22397 
22398 static int __Pyx_modinit_function_export_code(void) {
22399  __Pyx_RefNannyDeclarations
22400  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22401  /*--- Function export code ---*/
22402  __Pyx_RefNannyFinishContext();
22403  return 0;
22404 }
22405 
22406 static int __Pyx_modinit_type_init_code(void) {
22407  __Pyx_RefNannyDeclarations
22408  PyObject *__pyx_t_1 = NULL;
22409  int __pyx_lineno = 0;
22410  const char *__pyx_filename = NULL;
22411  int __pyx_clineno = 0;
22412  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22413  /*--- Type init code ---*/
22414  __pyx_t_1 = PyImport_ImportModule("imate._c_linear_operator.py_c_linear_operator"); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
22415  __Pyx_GOTREF(__pyx_t_1);
22416  __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = __Pyx_ImportType(__pyx_t_1, "imate._c_linear_operator.py_c_linear_operator", "pycLinearOperator", sizeof(struct __pyx_obj_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator), __Pyx_ImportType_CheckSize_Warn);
22417  if (!__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator) __PYX_ERR(0, 1, __pyx_L1_error)
22418  __pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator = (struct __pyx_vtabstruct_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator*)__Pyx_GetVtable(__pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator->tp_dict); if (unlikely(!__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator)) __PYX_ERR(0, 1, __pyx_L1_error)
22419  __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22420  __pyx_vtable_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.__pyx_base = *__pyx_vtabptr_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22421  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_base = __pyx_ptype_5imate_18_c_linear_operator_20py_c_linear_operator_pycLinearOperator;
22422  if (PyType_Ready(&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22423  #if PY_VERSION_HEX < 0x030800B1
22424  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_print = 0;
22425  #endif
22426  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dictoffset && __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro == PyObject_GenericGetAttr)) {
22427  __pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22428  }
22429  if (__Pyx_SetVtable(__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix.tp_dict, __pyx_vtabptr_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22430  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_pycMatrix, (PyObject *)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22431  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix) < 0) __PYX_ERR(0, 33, __pyx_L1_error)
22432  __pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix = &__pyx_type_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix;
22433  __pyx_vtabptr_array = &__pyx_vtable_array;
22434  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22435  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22436  #if PY_VERSION_HEX < 0x030800B1
22437  __pyx_type___pyx_array.tp_print = 0;
22438  #endif
22439  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22440  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(1, 105, __pyx_L1_error)
22441  __pyx_array_type = &__pyx_type___pyx_array;
22442  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22443  #if PY_VERSION_HEX < 0x030800B1
22444  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22445  #endif
22446  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22447  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22448  }
22449  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(1, 279, __pyx_L1_error)
22450  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22451  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22452  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22453  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22454  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22455  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22456  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22457  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22458  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22459  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22460  #if PY_VERSION_HEX < 0x030800B1
22461  __pyx_type___pyx_memoryview.tp_print = 0;
22462  #endif
22463  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22464  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22465  }
22466  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22467  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(1, 330, __pyx_L1_error)
22468  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22469  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22470  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22471  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22472  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22473  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22474  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22475  #if PY_VERSION_HEX < 0x030800B1
22476  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22477  #endif
22478  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22479  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22480  }
22481  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22482  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(1, 965, __pyx_L1_error)
22483  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22484  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22485  __Pyx_RefNannyFinishContext();
22486  return 0;
22487  __pyx_L1_error:;
22488  __Pyx_XDECREF(__pyx_t_1);
22489  __Pyx_RefNannyFinishContext();
22490  return -1;
22491 }
22492 
22493 static int __Pyx_modinit_type_import_code(void) {
22494  __Pyx_RefNannyDeclarations
22495  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22496  /*--- Type import code ---*/
22497  __Pyx_RefNannyFinishContext();
22498  return 0;
22499 }
22500 
22501 static int __Pyx_modinit_variable_import_code(void) {
22502  __Pyx_RefNannyDeclarations
22503  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22504  /*--- Variable import code ---*/
22505  __Pyx_RefNannyFinishContext();
22506  return 0;
22507 }
22508 
22509 static int __Pyx_modinit_function_import_code(void) {
22510  __Pyx_RefNannyDeclarations
22511  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22512  /*--- Function import code ---*/
22513  __Pyx_RefNannyFinishContext();
22514  return 0;
22515 }
22516 
22517 
22518 #ifndef CYTHON_NO_PYINIT_EXPORT
22519 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22520 #elif PY_MAJOR_VERSION < 3
22521 #ifdef __cplusplus
22522 #define __Pyx_PyMODINIT_FUNC extern "C" void
22523 #else
22524 #define __Pyx_PyMODINIT_FUNC void
22525 #endif
22526 #else
22527 #ifdef __cplusplus
22528 #define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
22529 #else
22530 #define __Pyx_PyMODINIT_FUNC PyObject *
22531 #endif
22532 #endif
22533 
22534 
22535 #if PY_MAJOR_VERSION < 3
22536 __Pyx_PyMODINIT_FUNC initpy_c_matrix(void) CYTHON_SMALL_CODE; /*proto*/
22537 __Pyx_PyMODINIT_FUNC initpy_c_matrix(void)
22538 #else
22539 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void) CYTHON_SMALL_CODE; /*proto*/
22540 __Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)
22541 #if CYTHON_PEP489_MULTI_PHASE_INIT
22542 {
22543  return PyModuleDef_Init(&__pyx_moduledef);
22544 }
22545 static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
22546  #if PY_VERSION_HEX >= 0x030700A1
22547  static PY_INT64_T main_interpreter_id = -1;
22548  PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
22549  if (main_interpreter_id == -1) {
22550  main_interpreter_id = current_id;
22551  return (unlikely(current_id == -1)) ? -1 : 0;
22552  } else if (unlikely(main_interpreter_id != current_id))
22553  #else
22554  static PyInterpreterState *main_interpreter = NULL;
22555  PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
22556  if (!main_interpreter) {
22557  main_interpreter = current_interpreter;
22558  } else if (unlikely(main_interpreter != current_interpreter))
22559  #endif
22560  {
22561  PyErr_SetString(
22562  PyExc_ImportError,
22563  "Interpreter change detected - this module can only be loaded into one interpreter per process.");
22564  return -1;
22565  }
22566  return 0;
22567 }
22568 static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none) {
22569  PyObject *value = PyObject_GetAttrString(spec, from_name);
22570  int result = 0;
22571  if (likely(value)) {
22572  if (allow_none || value != Py_None) {
22573  result = PyDict_SetItemString(moddict, to_name, value);
22574  }
22575  Py_DECREF(value);
22576  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22577  PyErr_Clear();
22578  } else {
22579  result = -1;
22580  }
22581  return result;
22582 }
22583 static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22584  PyObject *module = NULL, *moddict, *modname;
22585  if (__Pyx_check_single_interpreter())
22586  return NULL;
22587  if (__pyx_m)
22588  return __Pyx_NewRef(__pyx_m);
22589  modname = PyObject_GetAttrString(spec, "name");
22590  if (unlikely(!modname)) goto bad;
22591  module = PyModule_NewObject(modname);
22592  Py_DECREF(modname);
22593  if (unlikely(!module)) goto bad;
22594  moddict = PyModule_GetDict(module);
22595  if (unlikely(!moddict)) goto bad;
22596  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
22597  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
22598  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
22599  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
22600  return module;
22601 bad:
22602  Py_XDECREF(module);
22603  return NULL;
22604 }
22605 
22606 
22607 static CYTHON_SMALL_CODE int __pyx_pymod_exec_py_c_matrix(PyObject *__pyx_pyinit_module)
22608 #endif
22609 #endif
22610 {
22611  __Pyx_TraceDeclarations
22612  PyObject *__pyx_t_1 = NULL;
22613  PyObject *__pyx_t_2 = NULL;
22614  static PyThread_type_lock __pyx_t_3[8];
22615  int __pyx_lineno = 0;
22616  const char *__pyx_filename = NULL;
22617  int __pyx_clineno = 0;
22618  __Pyx_RefNannyDeclarations
22619  #if CYTHON_PEP489_MULTI_PHASE_INIT
22620  if (__pyx_m) {
22621  if (__pyx_m == __pyx_pyinit_module) return 0;
22622  PyErr_SetString(PyExc_RuntimeError, "Module 'py_c_matrix' has already been imported. Re-initialisation is not supported.");
22623  return -1;
22624  }
22625  #elif PY_MAJOR_VERSION >= 3
22626  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22627  #endif
22628  #if CYTHON_REFNANNY
22629 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22630 if (!__Pyx_RefNanny) {
22631  PyErr_Clear();
22632  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22633  if (!__Pyx_RefNanny)
22634  Py_FatalError("failed to import 'refnanny' module");
22635 }
22636 #endif
22637  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", 0);
22638  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22639  #ifdef __Pxy_PyFrame_Initialize_Offsets
22640  __Pxy_PyFrame_Initialize_Offsets();
22641  #endif
22642  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
22643  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
22644  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
22645  #ifdef __Pyx_CyFunction_USED
22646  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22647  #endif
22648  #ifdef __Pyx_FusedFunction_USED
22649  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22650  #endif
22651  #ifdef __Pyx_Coroutine_USED
22652  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22653  #endif
22654  #ifdef __Pyx_Generator_USED
22655  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22656  #endif
22657  #ifdef __Pyx_AsyncGen_USED
22658  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22659  #endif
22660  #ifdef __Pyx_StopAsyncIteration_USED
22661  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22662  #endif
22663  /*--- Library function declarations ---*/
22664  /*--- Threads initialization code ---*/
22665  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22666  PyEval_InitThreads();
22667  #endif
22668  /*--- Module creation code ---*/
22669  #if CYTHON_PEP489_MULTI_PHASE_INIT
22670  __pyx_m = __pyx_pyinit_module;
22671  Py_INCREF(__pyx_m);
22672  #else
22673  #if PY_MAJOR_VERSION < 3
22674  __pyx_m = Py_InitModule4("py_c_matrix", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22675  #else
22676  __pyx_m = PyModule_Create(&__pyx_moduledef);
22677  #endif
22678  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
22679  #endif
22680  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
22681  Py_INCREF(__pyx_d);
22682  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
22683  Py_INCREF(__pyx_b);
22684  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
22685  Py_INCREF(__pyx_cython_runtime);
22686  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
22687  /*--- Initialize various global constants etc. ---*/
22688  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22689  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22690  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22691  #endif
22692  if (__pyx_module_is_main_imate___c_linear_operator__py_c_matrix) {
22693  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name_2, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22694  }
22695  #if PY_MAJOR_VERSION >= 3
22696  {
22697  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
22698  if (!PyDict_GetItemString(modules, "imate._c_linear_operator.py_c_matrix")) {
22699  if (unlikely(PyDict_SetItemString(modules, "imate._c_linear_operator.py_c_matrix", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22700  }
22701  }
22702  #endif
22703  /*--- Builtin init code ---*/
22704  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22705  /*--- Constants init code ---*/
22706  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22707  /*--- Global type/function init code ---*/
22708  (void)__Pyx_modinit_global_init_code();
22709  (void)__Pyx_modinit_variable_export_code();
22710  (void)__Pyx_modinit_function_export_code();
22711  if (unlikely(__Pyx_modinit_type_init_code() < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
22712  (void)__Pyx_modinit_type_import_code();
22713  (void)__Pyx_modinit_variable_import_code();
22714  (void)__Pyx_modinit_function_import_code();
22715  /*--- Execution code ---*/
22716  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22717  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22718  #endif
22719  __Pyx_TraceCall("__Pyx_PyMODINIT_FUNC PyInit_py_c_matrix(void)", __pyx_f[0], 1, 0, __PYX_ERR(0, 1, __pyx_L1_error));
22720 
22721  /* "imate/_c_linear_operator/py_c_matrix.pyx":15
22722  *
22723  * # Python
22724  * import numpy # <<<<<<<<<<<<<<
22725  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix
22726  *
22727  */
22728  __Pyx_TraceLine(15,0,__PYX_ERR(0, 15, __pyx_L1_error))
22729  __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
22730  __Pyx_GOTREF(__pyx_t_1);
22731  if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 15, __pyx_L1_error)
22732  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22733 
22734  /* "imate/_c_linear_operator/py_c_matrix.pyx":16
22735  * # Python
22736  * import numpy
22737  * from scipy.sparse import issparse, isspmatrix_csr, isspmatrix_csc, csr_matrix # <<<<<<<<<<<<<<
22738  *
22739  * # Cython
22740  */
22741  __Pyx_TraceLine(16,0,__PYX_ERR(0, 16, __pyx_L1_error))
22742  __pyx_t_1 = PyList_New(4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22743  __Pyx_GOTREF(__pyx_t_1);
22744  __Pyx_INCREF(__pyx_n_s_issparse);
22745  __Pyx_GIVEREF(__pyx_n_s_issparse);
22746  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_issparse);
22747  __Pyx_INCREF(__pyx_n_s_isspmatrix_csr);
22748  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csr);
22749  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_isspmatrix_csr);
22750  __Pyx_INCREF(__pyx_n_s_isspmatrix_csc);
22751  __Pyx_GIVEREF(__pyx_n_s_isspmatrix_csc);
22752  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_isspmatrix_csc);
22753  __Pyx_INCREF(__pyx_n_s_csr_matrix);
22754  __Pyx_GIVEREF(__pyx_n_s_csr_matrix);
22755  PyList_SET_ITEM(__pyx_t_1, 3, __pyx_n_s_csr_matrix);
22756  __pyx_t_2 = __Pyx_Import(__pyx_n_s_scipy_sparse, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 16, __pyx_L1_error)
22757  __Pyx_GOTREF(__pyx_t_2);
22758  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22759  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_issparse); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22760  __Pyx_GOTREF(__pyx_t_1);
22761  if (PyDict_SetItem(__pyx_d, __pyx_n_s_issparse, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22762  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22763  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csr); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22764  __Pyx_GOTREF(__pyx_t_1);
22765  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csr, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22766  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22767  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_isspmatrix_csc); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22768  __Pyx_GOTREF(__pyx_t_1);
22769  if (PyDict_SetItem(__pyx_d, __pyx_n_s_isspmatrix_csc, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22770  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22771  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_csr_matrix); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 16, __pyx_L1_error)
22772  __Pyx_GOTREF(__pyx_t_1);
22773  if (PyDict_SetItem(__pyx_d, __pyx_n_s_csr_matrix, __pyx_t_1) < 0) __PYX_ERR(0, 16, __pyx_L1_error)
22774  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22776 
22777  /* "imate/_c_linear_operator/py_c_matrix.pyx":216
22778  * # ======================
22779  *
22780  * def set_dense_matrix_float(self, A): # <<<<<<<<<<<<<<
22781  * """
22782  * Sets matrix A.
22783  */
22784  __Pyx_TraceLine(216,0,__PYX_ERR(0, 216, __pyx_L1_error))
22785  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_3set_dense_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__4)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 216, __pyx_L1_error)
22786  __Pyx_GOTREF(__pyx_t_2);
22787  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 216, __pyx_L1_error)
22788  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22789  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22790 
22791  /* "imate/_c_linear_operator/py_c_matrix.pyx":272
22792  * # =======================
22793  *
22794  * def set_dense_matrix_double(self, A): # <<<<<<<<<<<<<<
22795  * """
22796  * Sets matrix A.
22797  */
22798  __Pyx_TraceLine(272,0,__PYX_ERR(0, 272, __pyx_L1_error))
22799  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_5set_dense_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_doubl, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 272, __pyx_L1_error)
22800  __Pyx_GOTREF(__pyx_t_2);
22801  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
22802  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22803  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22804 
22805  /* "imate/_c_linear_operator/py_c_matrix.pyx":328
22806  * # ============================
22807  *
22808  * def set_dense_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22809  * """
22810  * Sets matrix A.
22811  */
22812  __Pyx_TraceLine(328,0,__PYX_ERR(0, 328, __pyx_L1_error))
22813  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_7set_dense_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_dense_matrix_long, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__7)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 328, __pyx_L1_error)
22814  __Pyx_GOTREF(__pyx_t_2);
22815  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_dense_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 328, __pyx_L1_error)
22816  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22817  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22818 
22819  /* "imate/_c_linear_operator/py_c_matrix.pyx":384
22820  * # ====================
22821  *
22822  * def set_csr_matrix_float(self, A): # <<<<<<<<<<<<<<
22823  * """
22824  * """
22825  */
22826  __Pyx_TraceLine(384,0,__PYX_ERR(0, 384, __pyx_L1_error))
22827  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_9set_csr_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 384, __pyx_L1_error)
22828  __Pyx_GOTREF(__pyx_t_2);
22829  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 384, __pyx_L1_error)
22830  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22831  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22832 
22833  /* "imate/_c_linear_operator/py_c_matrix.pyx":431
22834  * # =====================
22835  *
22836  * def set_csr_matrix_double(self, A): # <<<<<<<<<<<<<<
22837  * """
22838  * """
22839  */
22840  __Pyx_TraceLine(431,0,__PYX_ERR(0, 431, __pyx_L1_error))
22841  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_11set_csr_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__9)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 431, __pyx_L1_error)
22842  __Pyx_GOTREF(__pyx_t_2);
22843  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 431, __pyx_L1_error)
22844  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22845  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22846 
22847  /* "imate/_c_linear_operator/py_c_matrix.pyx":478
22848  * # ==========================
22849  *
22850  * def set_csr_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22851  * """
22852  * """
22853  */
22854  __Pyx_TraceLine(478,0,__PYX_ERR(0, 478, __pyx_L1_error))
22855  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_13set_csr_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csr_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__10)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
22856  __Pyx_GOTREF(__pyx_t_2);
22857  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csr_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 478, __pyx_L1_error)
22858  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22859  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22860 
22861  /* "imate/_c_linear_operator/py_c_matrix.pyx":525
22862  * # ====================
22863  *
22864  * def set_csc_matrix_float(self, A): # <<<<<<<<<<<<<<
22865  * """
22866  * """
22867  */
22868  __Pyx_TraceLine(525,0,__PYX_ERR(0, 525, __pyx_L1_error))
22869  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_15set_csc_matrix_float, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_float, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__11)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 525, __pyx_L1_error)
22870  __Pyx_GOTREF(__pyx_t_2);
22871  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_float, __pyx_t_2) < 0) __PYX_ERR(0, 525, __pyx_L1_error)
22872  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22873  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22874 
22875  /* "imate/_c_linear_operator/py_c_matrix.pyx":572
22876  * # =====================
22877  *
22878  * def set_csc_matrix_double(self, A): # <<<<<<<<<<<<<<
22879  * """
22880  * """
22881  */
22882  __Pyx_TraceLine(572,0,__PYX_ERR(0, 572, __pyx_L1_error))
22883  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_17set_csc_matrix_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_double, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__12)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
22884  __Pyx_GOTREF(__pyx_t_2);
22885  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_double, __pyx_t_2) < 0) __PYX_ERR(0, 572, __pyx_L1_error)
22886  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22887  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22888 
22889  /* "imate/_c_linear_operator/py_c_matrix.pyx":619
22890  * # ==========================
22891  *
22892  * def set_csc_matrix_long_double(self, A): # <<<<<<<<<<<<<<
22893  * """
22894  * """
22895  */
22896  __Pyx_TraceLine(619,0,__PYX_ERR(0, 619, __pyx_L1_error))
22897  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_19set_csc_matrix_long_double, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix_set_csc_matrix_long_do, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 619, __pyx_L1_error)
22898  __Pyx_GOTREF(__pyx_t_2);
22899  if (PyDict_SetItem((PyObject *)__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix->tp_dict, __pyx_n_s_set_csc_matrix_long_double, __pyx_t_2) < 0) __PYX_ERR(0, 619, __pyx_L1_error)
22900  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22901  PyType_Modified(__pyx_ptype_5imate_18_c_linear_operator_11py_c_matrix_pycMatrix);
22902 
22903  /* "(tree fragment)":1
22904  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22905  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22906  * def __setstate_cython__(self, __pyx_state):
22907  */
22908  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
22909  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_21__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___reduce_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__14)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
22910  __Pyx_GOTREF(__pyx_t_2);
22911  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22912  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22913 
22914  /* "(tree fragment)":3
22915  * def __reduce_cython__(self):
22916  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22917  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22918  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22919  */
22920  __Pyx_TraceLine(3,0,__PYX_ERR(1, 3, __pyx_L1_error))
22921  __pyx_t_2 = __Pyx_CyFunction_New(&__pyx_mdef_5imate_18_c_linear_operator_11py_c_matrix_9pycMatrix_23__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_pycMatrix___setstate_cython, NULL, __pyx_n_s_imate__c_linear_operator_py_c_ma_2, __pyx_d, ((PyObject *)__pyx_codeobj__16)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 3, __pyx_L1_error)
22922  __Pyx_GOTREF(__pyx_t_2);
22923  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_2) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
22924  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22925 
22926  /* "imate/_c_linear_operator/py_c_matrix.pyx":1
22927  * # SPDX-FileCopyrightText: Copyright 2021, Siavash Ameli <sameli@berkeley.edu> # <<<<<<<<<<<<<<
22928  * # SPDX-License-Identifier: BSD-3-Clause
22929  * # SPDX-FileType: SOURCE
22930  */
22931  __Pyx_TraceLine(1,0,__PYX_ERR(0, 1, __pyx_L1_error))
22932  __pyx_t_2 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1, __pyx_L1_error)
22933  __Pyx_GOTREF(__pyx_t_2);
22934  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
22935  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22936 
22937  /* "View.MemoryView":209
22938  * info.obj = self
22939  *
22940  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
22941  *
22942  * def __dealloc__(array self):
22943  */
22944  __Pyx_TraceLine(209,0,__PYX_ERR(1, 209, __pyx_L1_error))
22945  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 209, __pyx_L1_error)
22946  __Pyx_GOTREF(__pyx_t_2);
22947  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 209, __pyx_L1_error)
22948  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
22949  PyType_Modified(__pyx_array_type);
22950 
22951  /* "View.MemoryView":226
22952  *
22953  * @cname('get_memview')
22954  * cdef get_memview(self): # <<<<<<<<<<<<<<
22955  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
22956  * return memoryview(self, flags, self.dtype_is_object)
22957  */
22958  __Pyx_TraceLine(226,0,__PYX_ERR(1, 226, __pyx_L1_error))
22959 
22960 
22961  /* "View.MemoryView":244
22962  *
22963  * @cname("__pyx_array_new")
22964  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
22965  * char *mode, char *buf):
22966  * cdef array result
22967  */
22968  __Pyx_TraceLine(244,0,__PYX_ERR(1, 244, __pyx_L1_error))
22969 
22970 
22971  /* "View.MemoryView":286
22972  * return self.name
22973  *
22974  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22975  * cdef strided = Enum("<strided and direct>") # default
22976  * cdef indirect = Enum("<strided and indirect>")
22977  */
22978  __Pyx_TraceLine(286,0,__PYX_ERR(1, 286, __pyx_L1_error))
22979  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 286, __pyx_L1_error)
22980  __Pyx_GOTREF(__pyx_t_2);
22981  __Pyx_XGOTREF(generic);
22982  __Pyx_DECREF_SET(generic, __pyx_t_2);
22983  __Pyx_GIVEREF(__pyx_t_2);
22984  __pyx_t_2 = 0;
22985 
22986  /* "View.MemoryView":287
22987  *
22988  * cdef generic = Enum("<strided and direct or indirect>")
22989  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22990  * cdef indirect = Enum("<strided and indirect>")
22991  *
22992  */
22993  __Pyx_TraceLine(287,0,__PYX_ERR(1, 287, __pyx_L1_error))
22994  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 287, __pyx_L1_error)
22995  __Pyx_GOTREF(__pyx_t_2);
22996  __Pyx_XGOTREF(strided);
22997  __Pyx_DECREF_SET(strided, __pyx_t_2);
22998  __Pyx_GIVEREF(__pyx_t_2);
22999  __pyx_t_2 = 0;
23000 
23001  /* "View.MemoryView":288
23002  * cdef generic = Enum("<strided and direct or indirect>")
23003  * cdef strided = Enum("<strided and direct>") # default
23004  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23005  *
23006  *
23007  */
23008  __Pyx_TraceLine(288,0,__PYX_ERR(1, 288, __pyx_L1_error))
23009  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 288, __pyx_L1_error)
23010  __Pyx_GOTREF(__pyx_t_2);
23011  __Pyx_XGOTREF(indirect);
23012  __Pyx_DECREF_SET(indirect, __pyx_t_2);
23013  __Pyx_GIVEREF(__pyx_t_2);
23014  __pyx_t_2 = 0;
23015 
23016  /* "View.MemoryView":291
23017  *
23018  *
23019  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23020  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23021  *
23022  */
23023  __Pyx_TraceLine(291,0,__PYX_ERR(1, 291, __pyx_L1_error))
23024  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 291, __pyx_L1_error)
23025  __Pyx_GOTREF(__pyx_t_2);
23026  __Pyx_XGOTREF(contiguous);
23027  __Pyx_DECREF_SET(contiguous, __pyx_t_2);
23028  __Pyx_GIVEREF(__pyx_t_2);
23029  __pyx_t_2 = 0;
23030 
23031  /* "View.MemoryView":292
23032  *
23033  * cdef contiguous = Enum("<contiguous and direct>")
23034  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23035  *
23036  *
23037  */
23038  __Pyx_TraceLine(292,0,__PYX_ERR(1, 292, __pyx_L1_error))
23039  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 292, __pyx_L1_error)
23040  __Pyx_GOTREF(__pyx_t_2);
23041  __Pyx_XGOTREF(indirect_contiguous);
23042  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_2);
23043  __Pyx_GIVEREF(__pyx_t_2);
23044  __pyx_t_2 = 0;
23045 
23046  /* "View.MemoryView":298
23047  *
23048  * @cname('__pyx_align_pointer')
23049  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
23050  * "Align pointer memory on a given boundary"
23051  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
23052  */
23053  __Pyx_TraceLine(298,0,__PYX_ERR(1, 298, __pyx_L1_error))
23054 
23055 
23056  /* "View.MemoryView":316
23057  *
23058  * DEF THREAD_LOCKS_PREALLOCATED = 8
23059  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23060  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23061  * PyThread_allocate_lock(),
23062  */
23063  __Pyx_TraceLine(316,0,__PYX_ERR(1, 316, __pyx_L1_error))
23064  __pyx_memoryview_thread_locks_used = 0;
23065 
23066  /* "View.MemoryView":317
23067  * DEF THREAD_LOCKS_PREALLOCATED = 8
23068  * cdef int __pyx_memoryview_thread_locks_used = 0
23069  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23070  * PyThread_allocate_lock(),
23071  * PyThread_allocate_lock(),
23072  */
23073  __Pyx_TraceLine(317,0,__PYX_ERR(1, 317, __pyx_L1_error))
23074  __pyx_t_3[0] = PyThread_allocate_lock();
23075  __pyx_t_3[1] = PyThread_allocate_lock();
23076  __pyx_t_3[2] = PyThread_allocate_lock();
23077  __pyx_t_3[3] = PyThread_allocate_lock();
23078  __pyx_t_3[4] = PyThread_allocate_lock();
23079  __pyx_t_3[5] = PyThread_allocate_lock();
23080  __pyx_t_3[6] = PyThread_allocate_lock();
23081  __pyx_t_3[7] = PyThread_allocate_lock();
23082  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23083 
23084  /* "View.MemoryView":393
23085  * PyThread_free_lock(self.lock)
23086  *
23087  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
23088  * cdef Py_ssize_t dim
23089  * cdef char *itemp = <char *> self.view.buf
23090  */
23091  __Pyx_TraceLine(393,0,__PYX_ERR(1, 393, __pyx_L1_error))
23092 
23093 
23094  /* "View.MemoryView":431
23095  * self.setitem_indexed(index, value)
23096  *
23097  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
23098  * if not isinstance(obj, memoryview):
23099  * try:
23100  */
23101  __Pyx_TraceLine(431,0,__PYX_ERR(1, 431, __pyx_L1_error))
23102 
23103 
23104  /* "View.MemoryView":441
23105  * return obj
23106  *
23107  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
23108  * cdef __Pyx_memviewslice dst_slice
23109  * cdef __Pyx_memviewslice src_slice
23110  */
23111  __Pyx_TraceLine(441,0,__PYX_ERR(1, 441, __pyx_L1_error))
23112 
23113 
23114  /* "View.MemoryView":449
23115  * src.ndim, dst.ndim, self.dtype_is_object)
23116  *
23117  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
23118  * cdef int array[128]
23119  * cdef void *tmp = NULL
23120  */
23121  __Pyx_TraceLine(449,0,__PYX_ERR(1, 449, __pyx_L1_error))
23122 
23123 
23124  /* "View.MemoryView":481
23125  * PyMem_Free(tmp)
23126  *
23127  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
23128  * cdef char *itemp = self.get_item_pointer(index)
23129  * self.assign_item_from_object(itemp, value)
23130  */
23131  __Pyx_TraceLine(481,0,__PYX_ERR(1, 481, __pyx_L1_error))
23132 
23133 
23134  /* "View.MemoryView":485
23135  * self.assign_item_from_object(itemp, value)
23136  *
23137  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
23138  * """Only used if instantiated manually by the user, or if Cython doesn't
23139  * know how to convert the type"""
23140  */
23141  __Pyx_TraceLine(485,0,__PYX_ERR(1, 485, __pyx_L1_error))
23142 
23143 
23144  /* "View.MemoryView":501
23145  * return result
23146  *
23147  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
23148  * """Only used if instantiated manually by the user, or if Cython doesn't
23149  * know how to convert the type"""
23150  */
23151  __Pyx_TraceLine(501,0,__PYX_ERR(1, 501, __pyx_L1_error))
23152 
23153 
23154  /* "View.MemoryView":549
23155  * info.obj = self
23156  *
23157  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23158  *
23159  *
23160  */
23161  __Pyx_TraceLine(549,0,__PYX_ERR(1, 549, __pyx_L1_error))
23162  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 549, __pyx_L1_error)
23163  __Pyx_GOTREF(__pyx_t_2);
23164  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 549, __pyx_L1_error)
23165  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23166  PyType_Modified(__pyx_memoryview_type);
23167 
23168  /* "View.MemoryView":657
23169  *
23170  * @cname('__pyx_memoryview_new')
23171  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
23172  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
23173  * result.typeinfo = typeinfo
23174  */
23175  __Pyx_TraceLine(657,0,__PYX_ERR(1, 657, __pyx_L1_error))
23176 
23177 
23178  /* "View.MemoryView":663
23179  *
23180  * @cname('__pyx_memoryview_check')
23181  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
23182  * return isinstance(o, memoryview)
23183  *
23184  */
23185  __Pyx_TraceLine(663,0,__PYX_ERR(1, 663, __pyx_L1_error))
23186 
23187 
23188  /* "View.MemoryView":666
23189  * return isinstance(o, memoryview)
23190  *
23191  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
23192  * """
23193  * Replace all ellipses with full slices and fill incomplete indices with
23194  */
23195  __Pyx_TraceLine(666,0,__PYX_ERR(1, 666, __pyx_L1_error))
23196 
23197 
23198  /* "View.MemoryView":700
23199  * return have_slices or nslices, tuple(result)
23200  *
23201  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
23202  * for suboffset in suboffsets[:ndim]:
23203  * if suboffset >= 0:
23204  */
23205  __Pyx_TraceLine(700,0,__PYX_ERR(1, 700, __pyx_L1_error))
23206 
23207 
23208  /* "View.MemoryView":710
23209  *
23210  * @cname('__pyx_memview_slice')
23211  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
23212  * cdef int new_ndim = 0, suboffset_dim = -1, dim
23213  * cdef bint negative_step
23214  */
23215  __Pyx_TraceLine(710,0,__PYX_ERR(1, 710, __pyx_L1_error))
23216 
23217 
23218  /* "View.MemoryView":807
23219  *
23220  * @cname('__pyx_memoryview_slice_memviewslice')
23221  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
23222  * __Pyx_memviewslice *dst,
23223  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
23224  */
23225  __Pyx_TraceLine(807,0,__PYX_ERR(1, 807, __pyx_L1_error))
23226 
23227 
23228  /* "View.MemoryView":910
23229  *
23230  * @cname('__pyx_pybuffer_index')
23231  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
23232  * Py_ssize_t dim) except NULL:
23233  * cdef Py_ssize_t shape, stride, suboffset = -1
23234  */
23235  __Pyx_TraceLine(910,0,__PYX_ERR(1, 910, __pyx_L1_error))
23236 
23237 
23238  /* "View.MemoryView":943
23239  *
23240  * @cname('__pyx_memslice_transpose')
23241  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
23242  * cdef int ndim = memslice.memview.view.ndim
23243  *
23244  */
23245  __Pyx_TraceLine(943,0,__PYX_ERR(1, 943, __pyx_L1_error))
23246 
23247 
23248  /* "View.MemoryView":979
23249  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
23250  *
23251  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
23252  * if self.to_object_func != NULL:
23253  * return self.to_object_func(itemp)
23254  */
23255  __Pyx_TraceLine(979,0,__PYX_ERR(1, 979, __pyx_L1_error))
23256 
23257 
23258  /* "View.MemoryView":985
23259  * return memoryview.convert_item_to_object(self, itemp)
23260  *
23261  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
23262  * if self.to_dtype_func != NULL:
23263  * self.to_dtype_func(itemp, value)
23264  */
23265  __Pyx_TraceLine(985,0,__PYX_ERR(1, 985, __pyx_L1_error))
23266 
23267 
23268  /* "View.MemoryView":995
23269  * return self.from_object
23270  *
23271  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23272  *
23273  *
23274  */
23275  __Pyx_TraceLine(995,0,__PYX_ERR(1, 995, __pyx_L1_error))
23276  __pyx_t_2 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 995, __pyx_L1_error)
23277  __Pyx_GOTREF(__pyx_t_2);
23278  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_2) < 0) __PYX_ERR(1, 995, __pyx_L1_error)
23279  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23280  PyType_Modified(__pyx_memoryviewslice_type);
23281 
23282  /* "View.MemoryView":999
23283  *
23284  * @cname('__pyx_memoryview_fromslice')
23285  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
23286  * int ndim,
23287  * object (*to_object_func)(char *),
23288  */
23289  __Pyx_TraceLine(999,0,__PYX_ERR(1, 999, __pyx_L1_error))
23290 
23291 
23292  /* "View.MemoryView":1052
23293  *
23294  * @cname('__pyx_memoryview_get_slice_from_memoryview')
23295  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
23296  * __Pyx_memviewslice *mslice) except NULL:
23297  * cdef _memoryviewslice obj
23298  */
23299  __Pyx_TraceLine(1052,0,__PYX_ERR(1, 1052, __pyx_L1_error))
23300 
23301 
23302  /* "View.MemoryView":1063
23303  *
23304  * @cname('__pyx_memoryview_slice_copy')
23305  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
23306  * cdef int dim
23307  * cdef (Py_ssize_t*) shape, strides, suboffsets
23308  */
23309  __Pyx_TraceLine(1063,0,__PYX_ERR(1, 1063, __pyx_L1_error))
23310 
23311 
23312  /* "View.MemoryView":1080
23313  *
23314  * @cname('__pyx_memoryview_copy_object')
23315  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
23316  * "Create a new memoryview object"
23317  * cdef __Pyx_memviewslice memviewslice
23318  */
23319  __Pyx_TraceLine(1080,0,__PYX_ERR(1, 1080, __pyx_L1_error))
23320 
23321 
23322  /* "View.MemoryView":1087
23323  *
23324  * @cname('__pyx_memoryview_copy_object_from_slice')
23325  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
23326  * """
23327  * Create a new memoryview object from a given memoryview object and slice.
23328  */
23329  __Pyx_TraceLine(1087,0,__PYX_ERR(1, 1087, __pyx_L1_error))
23330 
23331 
23332  /* "View.MemoryView":1109
23333  *
23334  *
23335  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
23336  * if arg < 0:
23337  * return -arg
23338  */
23339  __Pyx_TraceLine(1109,0,__PYX_ERR(1, 1109, __pyx_L1_error))
23340 
23341 
23342  /* "View.MemoryView":1116
23343  *
23344  * @cname('__pyx_get_best_slice_order')
23345  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
23346  * """
23347  * Figure out the best memory access order for a given slice.
23348  */
23349  __Pyx_TraceLine(1116,0,__PYX_ERR(1, 1116, __pyx_L1_error))
23350 
23351 
23352  /* "View.MemoryView":1170
23353  * dst_data += dst_stride
23354  *
23355  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23356  * __Pyx_memviewslice *dst,
23357  * int ndim, size_t itemsize) nogil:
23358  */
23359  __Pyx_TraceLine(1170,0,__PYX_ERR(1, 1170, __pyx_L1_error))
23360 
23361 
23362  /* "View.MemoryView":1177
23363  *
23364  * @cname('__pyx_memoryview_slice_get_size')
23365  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
23366  * "Return the size of the memory occupied by the slice in number of bytes"
23367  * cdef Py_ssize_t shape, size = src.memview.view.itemsize
23368  */
23369  __Pyx_TraceLine(1177,0,__PYX_ERR(1, 1177, __pyx_L1_error))
23370 
23371 
23372  /* "View.MemoryView":1187
23373  *
23374  * @cname('__pyx_fill_contig_strides_array')
23375  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
23376  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
23377  * int ndim, char order) nogil:
23378  */
23379  __Pyx_TraceLine(1187,0,__PYX_ERR(1, 1187, __pyx_L1_error))
23380 
23381 
23382  /* "View.MemoryView":1208
23383  *
23384  * @cname('__pyx_memoryview_copy_data_to_temp')
23385  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
23386  * __Pyx_memviewslice *tmpslice,
23387  * char order,
23388  */
23389  __Pyx_TraceLine(1208,0,__PYX_ERR(1, 1208, __pyx_L1_error))
23390 
23391 
23392  /* "View.MemoryView":1251
23393  *
23394  * @cname('__pyx_memoryview_err_extents')
23395  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
23396  * Py_ssize_t extent2) except -1 with gil:
23397  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
23398  */
23399  __Pyx_TraceLine(1251,0,__PYX_ERR(1, 1251, __pyx_L1_error))
23400 
23401 
23402  /* "View.MemoryView":1257
23403  *
23404  * @cname('__pyx_memoryview_err_dim')
23405  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
23406  * raise error(msg.decode('ascii') % dim)
23407  *
23408  */
23409  __Pyx_TraceLine(1257,0,__PYX_ERR(1, 1257, __pyx_L1_error))
23410 
23411 
23412  /* "View.MemoryView":1261
23413  *
23414  * @cname('__pyx_memoryview_err')
23415  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
23416  * if msg != NULL:
23417  * raise error(msg.decode('ascii'))
23418  */
23419  __Pyx_TraceLine(1261,0,__PYX_ERR(1, 1261, __pyx_L1_error))
23420 
23421 
23422  /* "View.MemoryView":1268
23423  *
23424  * @cname('__pyx_memoryview_copy_contents')
23425  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
23426  * __Pyx_memviewslice dst,
23427  * int src_ndim, int dst_ndim,
23428  */
23429  __Pyx_TraceLine(1268,0,__PYX_ERR(1, 1268, __pyx_L1_error))
23430 
23431 
23432  /* "View.MemoryView":1340
23433  *
23434  * @cname('__pyx_memoryview_broadcast_leading')
23435  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
23436  * int ndim,
23437  * int ndim_other) nogil:
23438  */
23439  __Pyx_TraceLine(1340,0,__PYX_ERR(1, 1340, __pyx_L1_error))
23440 
23441 
23442  /* "View.MemoryView":1362
23443  *
23444  * @cname('__pyx_memoryview_refcount_copying')
23445  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
23446  * int ndim, bint inc) nogil:
23447  *
23448  */
23449  __Pyx_TraceLine(1362,0,__PYX_ERR(1, 1362, __pyx_L1_error))
23450 
23451 
23452  /* "View.MemoryView":1371
23453  *
23454  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
23455  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23456  * Py_ssize_t *strides, int ndim,
23457  * bint inc) with gil:
23458  */
23459  __Pyx_TraceLine(1371,0,__PYX_ERR(1, 1371, __pyx_L1_error))
23460 
23461 
23462  /* "View.MemoryView":1377
23463  *
23464  * @cname('__pyx_memoryview_refcount_objects_in_slice')
23465  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23466  * Py_ssize_t *strides, int ndim, bint inc):
23467  * cdef Py_ssize_t i
23468  */
23469  __Pyx_TraceLine(1377,0,__PYX_ERR(1, 1377, __pyx_L1_error))
23470 
23471 
23472  /* "View.MemoryView":1397
23473  *
23474  * @cname('__pyx_memoryview_slice_assign_scalar')
23475  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
23476  * size_t itemsize, void *item,
23477  * bint dtype_is_object) nogil:
23478  */
23479  __Pyx_TraceLine(1397,0,__PYX_ERR(1, 1397, __pyx_L1_error))
23480 
23481 
23482  /* "View.MemoryView":1407
23483  *
23484  * @cname('__pyx_memoryview__slice_assign_scalar')
23485  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
23486  * Py_ssize_t *strides, int ndim,
23487  * size_t itemsize, void *item) nogil:
23488  */
23489  __Pyx_TraceLine(1407,0,__PYX_ERR(1, 1407, __pyx_L1_error))
23490 
23491 
23492  /* "(tree fragment)":1
23493  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23494  * cdef object __pyx_PickleError
23495  * cdef object __pyx_result
23496  */
23497  __Pyx_TraceLine(1,0,__PYX_ERR(1, 1, __pyx_L1_error))
23498  __pyx_t_2 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 1, __pyx_L1_error)
23499  __Pyx_GOTREF(__pyx_t_2);
23500  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_2) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23501  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
23502 
23503  /* "(tree fragment)":11
23504  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23505  * return __pyx_result
23506  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23507  * __pyx_result.name = __pyx_state[0]
23508  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23509  */
23510  __Pyx_TraceLine(11,0,__PYX_ERR(1, 11, __pyx_L1_error))
23511 
23512  __Pyx_TraceReturn(Py_None, 0);
23513 
23514  /*--- Wrapped vars code ---*/
23515 
23516  goto __pyx_L0;
23517  __pyx_L1_error:;
23518  __Pyx_XDECREF(__pyx_t_1);
23519  __Pyx_XDECREF(__pyx_t_2);
23520  if (__pyx_m) {
23521  if (__pyx_d) {
23522  __Pyx_AddTraceback("init imate._c_linear_operator.py_c_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
23523  }
23524  Py_CLEAR(__pyx_m);
23525  } else if (!PyErr_Occurred()) {
23526  PyErr_SetString(PyExc_ImportError, "init imate._c_linear_operator.py_c_matrix");
23527  }
23528  __pyx_L0:;
23529  __Pyx_RefNannyFinishContext();
23530  #if CYTHON_PEP489_MULTI_PHASE_INIT
23531  return (__pyx_m != NULL) ? 0 : -1;
23532  #elif PY_MAJOR_VERSION >= 3
23533  return __pyx_m;
23534  #else
23535  return;
23536  #endif
23537 }
23538 
23539 /* --- Runtime support code --- */
23540 /* Refnanny */
23541 #if CYTHON_REFNANNY
23542 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23543  PyObject *m = NULL, *p = NULL;
23544  void *r = NULL;
23545  m = PyImport_ImportModule(modname);
23546  if (!m) goto end;
23547  p = PyObject_GetAttrString(m, "RefNannyAPI");
23548  if (!p) goto end;
23549  r = PyLong_AsVoidPtr(p);
23550 end:
23551  Py_XDECREF(p);
23552  Py_XDECREF(m);
23553  return (__Pyx_RefNannyAPIStruct *)r;
23554 }
23555 #endif
23556 
23557 /* PyObjectGetAttrStr */
23558 #if CYTHON_USE_TYPE_SLOTS
23559 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23560  PyTypeObject* tp = Py_TYPE(obj);
23561  if (likely(tp->tp_getattro))
23562  return tp->tp_getattro(obj, attr_name);
23563 #if PY_MAJOR_VERSION < 3
23564  if (likely(tp->tp_getattr))
23565  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23566 #endif
23567  return PyObject_GetAttr(obj, attr_name);
23568 }
23569 #endif
23570 
23571 /* GetBuiltinName */
23572 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23573  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23574  if (unlikely(!result)) {
23575  PyErr_Format(PyExc_NameError,
23576 #if PY_MAJOR_VERSION >= 3
23577  "name '%U' is not defined", name);
23578 #else
23579  "name '%.200s' is not defined", PyString_AS_STRING(name));
23580 #endif
23581  }
23582  return result;
23583 }
23584 
23585 /* RaiseDoubleKeywords */
23586 static void __Pyx_RaiseDoubleKeywordsError(
23587  const char* func_name,
23588  PyObject* kw_name)
23589 {
23590  PyErr_Format(PyExc_TypeError,
23591  #if PY_MAJOR_VERSION >= 3
23592  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23593  #else
23594  "%s() got multiple values for keyword argument '%s'", func_name,
23595  PyString_AsString(kw_name));
23596  #endif
23597 }
23598 
23599 /* ParseKeywords */
23600 static int __Pyx_ParseOptionalKeywords(
23601  PyObject *kwds,
23602  PyObject **argnames[],
23603  PyObject *kwds2,
23604  PyObject *values[],
23605  Py_ssize_t num_pos_args,
23606  const char* function_name)
23607 {
23608  PyObject *key = 0, *value = 0;
23609  Py_ssize_t pos = 0;
23610  PyObject*** name;
23611  PyObject*** first_kw_arg = argnames + num_pos_args;
23612  while (PyDict_Next(kwds, &pos, &key, &value)) {
23613  name = first_kw_arg;
23614  while (*name && (**name != key)) name++;
23615  if (*name) {
23616  values[name-argnames] = value;
23617  continue;
23618  }
23619  name = first_kw_arg;
23620  #if PY_MAJOR_VERSION < 3
23621  if (likely(PyString_Check(key))) {
23622  while (*name) {
23623  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23624  && _PyString_Eq(**name, key)) {
23625  values[name-argnames] = value;
23626  break;
23627  }
23628  name++;
23629  }
23630  if (*name) continue;
23631  else {
23632  PyObject*** argname = argnames;
23633  while (argname != first_kw_arg) {
23634  if ((**argname == key) || (
23635  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23636  && _PyString_Eq(**argname, key))) {
23637  goto arg_passed_twice;
23638  }
23639  argname++;
23640  }
23641  }
23642  } else
23643  #endif
23644  if (likely(PyUnicode_Check(key))) {
23645  while (*name) {
23646  int cmp = (**name == key) ? 0 :
23647  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23648  (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23649  #endif
23650  PyUnicode_Compare(**name, key);
23651  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23652  if (cmp == 0) {
23653  values[name-argnames] = value;
23654  break;
23655  }
23656  name++;
23657  }
23658  if (*name) continue;
23659  else {
23660  PyObject*** argname = argnames;
23661  while (argname != first_kw_arg) {
23662  int cmp = (**argname == key) ? 0 :
23663  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23664  (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
23665  #endif
23666  PyUnicode_Compare(**argname, key);
23667  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23668  if (cmp == 0) goto arg_passed_twice;
23669  argname++;
23670  }
23671  }
23672  } else
23673  goto invalid_keyword_type;
23674  if (kwds2) {
23675  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23676  } else {
23677  goto invalid_keyword;
23678  }
23679  }
23680  return 0;
23681 arg_passed_twice:
23682  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23683  goto bad;
23684 invalid_keyword_type:
23685  PyErr_Format(PyExc_TypeError,
23686  "%.200s() keywords must be strings", function_name);
23687  goto bad;
23688 invalid_keyword:
23689  PyErr_Format(PyExc_TypeError,
23690  #if PY_MAJOR_VERSION < 3
23691  "%.200s() got an unexpected keyword argument '%.200s'",
23692  function_name, PyString_AsString(key));
23693  #else
23694  "%s() got an unexpected keyword argument '%U'",
23695  function_name, key);
23696  #endif
23697 bad:
23698  return -1;
23699 }
23700 
23701 /* RaiseArgTupleInvalid */
23702 static void __Pyx_RaiseArgtupleInvalid(
23703  const char* func_name,
23704  int exact,
23705  Py_ssize_t num_min,
23706  Py_ssize_t num_max,
23707  Py_ssize_t num_found)
23708 {
23709  Py_ssize_t num_expected;
23710  const char *more_or_less;
23711  if (num_found < num_min) {
23712  num_expected = num_min;
23713  more_or_less = "at least";
23714  } else {
23715  num_expected = num_max;
23716  more_or_less = "at most";
23717  }
23718  if (exact) {
23719  more_or_less = "exactly";
23720  }
23721  PyErr_Format(PyExc_TypeError,
23722  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23723  func_name, more_or_less, num_expected,
23724  (num_expected == 1) ? "" : "s", num_found);
23725 }
23726 
23727 /* PyErrFetchRestore */
23728 #if CYTHON_FAST_THREAD_STATE
23729 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
23730  PyObject *tmp_type, *tmp_value, *tmp_tb;
23731  tmp_type = tstate->curexc_type;
23732  tmp_value = tstate->curexc_value;
23733  tmp_tb = tstate->curexc_traceback;
23734  tstate->curexc_type = type;
23735  tstate->curexc_value = value;
23736  tstate->curexc_traceback = tb;
23737  Py_XDECREF(tmp_type);
23738  Py_XDECREF(tmp_value);
23739  Py_XDECREF(tmp_tb);
23740 }
23741 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
23742  *type = tstate->curexc_type;
23743  *value = tstate->curexc_value;
23744  *tb = tstate->curexc_traceback;
23745  tstate->curexc_type = 0;
23746  tstate->curexc_value = 0;
23747  tstate->curexc_traceback = 0;
23748 }
23749 #endif
23750 
23751 /* Profile */
23752 #if CYTHON_PROFILE
23753 static int __Pyx_TraceSetupAndCall(PyCodeObject** code,
23754  PyFrameObject** frame,
23755  PyThreadState* tstate,
23756  const char *funcname,
23757  const char *srcfile,
23758  int firstlineno) {
23759  PyObject *type, *value, *traceback;
23760  int retval;
23761  if (*frame == NULL || !CYTHON_PROFILE_REUSE_FRAME) {
23762  if (*code == NULL) {
23763  *code = __Pyx_createFrameCodeObject(funcname, srcfile, firstlineno);
23764  if (*code == NULL) return 0;
23765  }
23766  *frame = PyFrame_New(
23767  tstate, /*PyThreadState *tstate*/
23768  *code, /*PyCodeObject *code*/
23769  __pyx_d, /*PyObject *globals*/
23770  0 /*PyObject *locals*/
23771  );
23772  if (*frame == NULL) return 0;
23773  if (CYTHON_TRACE && (*frame)->f_trace == NULL) {
23774  Py_INCREF(Py_None);
23775  (*frame)->f_trace = Py_None;
23776  }
23777 #if PY_VERSION_HEX < 0x030400B1
23778  } else {
23779  (*frame)->f_tstate = tstate;
23780 #endif
23781  }
23782  __Pyx_PyFrame_SetLineNumber(*frame, firstlineno);
23783  retval = 1;
23784  tstate->tracing++;
23785  __Pyx_SetTracing(tstate, 0);
23786  __Pyx_ErrFetchInState(tstate, &type, &value, &traceback);
23787  #if CYTHON_TRACE
23788  if (tstate->c_tracefunc)
23789  retval = tstate->c_tracefunc(tstate->c_traceobj, *frame, PyTrace_CALL, NULL) == 0;
23790  if (retval && tstate->c_profilefunc)
23791  #endif
23792  retval = tstate->c_profilefunc(tstate->c_profileobj, *frame, PyTrace_CALL, NULL) == 0;
23793  __Pyx_SetTracing(tstate, (tstate->c_profilefunc || (CYTHON_TRACE && tstate->c_tracefunc)));
23794  tstate->tracing--;
23795  if (retval) {
23796  __Pyx_ErrRestoreInState(tstate, type, value, traceback);
23797  return __Pyx_IsTracing(tstate, 0, 0) && retval;
23798  } else {
23799  Py_XDECREF(type);
23800  Py_XDECREF(value);
23801  Py_XDECREF(traceback);
23802  return -1;
23803  }
23804 }
23805 static PyCodeObject *__Pyx_createFrameCodeObject(const char *funcname, const char *srcfile, int firstlineno) {
23806  PyCodeObject *py_code = 0;
23807 #if PY_MAJOR_VERSION >= 3
23808  py_code = PyCode_NewEmpty(srcfile, funcname, firstlineno);
23809  if (likely(py_code)) {
23810  py_code->co_flags |= CO_OPTIMIZED | CO_NEWLOCALS;
23811  }
23812 #else
23813  PyObject *py_srcfile = 0;
23814  PyObject *py_funcname = 0;
23815  py_funcname = PyString_FromString(funcname);
23816  if (unlikely(!py_funcname)) goto bad;
23817  py_srcfile = PyString_FromString(srcfile);
23818  if (unlikely(!py_srcfile)) goto bad;
23819  py_code = PyCode_New(
23820  0,
23821  0,
23822  0,
23823  CO_OPTIMIZED | CO_NEWLOCALS,
23824  __pyx_empty_bytes, /*PyObject *code,*/
23825  __pyx_empty_tuple, /*PyObject *consts,*/
23826  __pyx_empty_tuple, /*PyObject *names,*/
23827  __pyx_empty_tuple, /*PyObject *varnames,*/
23828  __pyx_empty_tuple, /*PyObject *freevars,*/
23829  __pyx_empty_tuple, /*PyObject *cellvars,*/
23830  py_srcfile, /*PyObject *filename,*/
23831  py_funcname, /*PyObject *name,*/
23832  firstlineno,
23833  __pyx_empty_bytes /*PyObject *lnotab*/
23834  );
23835 bad:
23836  Py_XDECREF(py_srcfile);
23837  Py_XDECREF(py_funcname);
23838 #endif
23839  return py_code;
23840 }
23841 #endif
23842 
23843 /* PyObjectCall */
23844 #if CYTHON_COMPILING_IN_CPYTHON
23845 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
23846  PyObject *result;
23847  ternaryfunc call = Py_TYPE(func)->tp_call;
23848  if (unlikely(!call))
23849  return PyObject_Call(func, arg, kw);
23850  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
23851  return NULL;
23852  result = (*call)(func, arg, kw);
23853  Py_LeaveRecursiveCall();
23854  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
23855  PyErr_SetString(
23856  PyExc_SystemError,
23857  "NULL result without error in PyObject_Call");
23858  }
23859  return result;
23860 }
23861 #endif
23862 
23863 /* RaiseException */
23864 #if PY_MAJOR_VERSION < 3
23865 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
23866  CYTHON_UNUSED PyObject *cause) {
23867  __Pyx_PyThreadState_declare
23868  Py_XINCREF(type);
23869  if (!value || value == Py_None)
23870  value = NULL;
23871  else
23872  Py_INCREF(value);
23873  if (!tb || tb == Py_None)
23874  tb = NULL;
23875  else {
23876  Py_INCREF(tb);
23877  if (!PyTraceBack_Check(tb)) {
23878  PyErr_SetString(PyExc_TypeError,
23879  "raise: arg 3 must be a traceback or None");
23880  goto raise_error;
23881  }
23882  }
23883  if (PyType_Check(type)) {
23884 #if CYTHON_COMPILING_IN_PYPY
23885  if (!value) {
23886  Py_INCREF(Py_None);
23887  value = Py_None;
23888  }
23889 #endif
23890  PyErr_NormalizeException(&type, &value, &tb);
23891  } else {
23892  if (value) {
23893  PyErr_SetString(PyExc_TypeError,
23894  "instance exception may not have a separate value");
23895  goto raise_error;
23896  }
23897  value = type;
23898  type = (PyObject*) Py_TYPE(type);
23899  Py_INCREF(type);
23900  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
23901  PyErr_SetString(PyExc_TypeError,
23902  "raise: exception class must be a subclass of BaseException");
23903  goto raise_error;
23904  }
23905  }
23906  __Pyx_PyThreadState_assign
23907  __Pyx_ErrRestore(type, value, tb);
23908  return;
23909 raise_error:
23910  Py_XDECREF(value);
23911  Py_XDECREF(type);
23912  Py_XDECREF(tb);
23913  return;
23914 }
23915 #else
23916 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
23917  PyObject* owned_instance = NULL;
23918  if (tb == Py_None) {
23919  tb = 0;
23920  } else if (tb && !PyTraceBack_Check(tb)) {
23921  PyErr_SetString(PyExc_TypeError,
23922  "raise: arg 3 must be a traceback or None");
23923  goto bad;
23924  }
23925  if (value == Py_None)
23926  value = 0;
23927  if (PyExceptionInstance_Check(type)) {
23928  if (value) {
23929  PyErr_SetString(PyExc_TypeError,
23930  "instance exception may not have a separate value");
23931  goto bad;
23932  }
23933  value = type;
23934  type = (PyObject*) Py_TYPE(value);
23935  } else if (PyExceptionClass_Check(type)) {
23936  PyObject *instance_class = NULL;
23937  if (value && PyExceptionInstance_Check(value)) {
23938  instance_class = (PyObject*) Py_TYPE(value);
23939  if (instance_class != type) {
23940  int is_subclass = PyObject_IsSubclass(instance_class, type);
23941  if (!is_subclass) {
23942  instance_class = NULL;
23943  } else if (unlikely(is_subclass == -1)) {
23944  goto bad;
23945  } else {
23946  type = instance_class;
23947  }
23948  }
23949  }
23950  if (!instance_class) {
23951  PyObject *args;
23952  if (!value)
23953  args = PyTuple_New(0);
23954  else if (PyTuple_Check(value)) {
23955  Py_INCREF(value);
23956  args = value;
23957  } else
23958  args = PyTuple_Pack(1, value);
23959  if (!args)
23960  goto bad;
23961  owned_instance = PyObject_Call(type, args, NULL);
23962  Py_DECREF(args);
23963  if (!owned_instance)
23964  goto bad;
23965  value = owned_instance;
23966  if (!PyExceptionInstance_Check(value)) {
23967  PyErr_Format(PyExc_TypeError,
23968  "calling %R should have returned an instance of "
23969  "BaseException, not %R",
23970  type, Py_TYPE(value));
23971  goto bad;
23972  }
23973  }
23974  } else {
23975  PyErr_SetString(PyExc_TypeError,
23976  "raise: exception class must be a subclass of BaseException");
23977  goto bad;
23978  }
23979  if (cause) {
23980  PyObject *fixed_cause;
23981  if (cause == Py_None) {
23982  fixed_cause = NULL;
23983  } else if (PyExceptionClass_Check(cause)) {
23984  fixed_cause = PyObject_CallObject(cause, NULL);
23985  if (fixed_cause == NULL)
23986  goto bad;
23987  } else if (PyExceptionInstance_Check(cause)) {
23988  fixed_cause = cause;
23989  Py_INCREF(fixed_cause);
23990  } else {
23991  PyErr_SetString(PyExc_TypeError,
23992  "exception causes must derive from "
23993  "BaseException");
23994  goto bad;
23995  }
23996  PyException_SetCause(value, fixed_cause);
23997  }
23998  PyErr_SetObject(type, value);
23999  if (tb) {
24000 #if CYTHON_COMPILING_IN_PYPY
24001  PyObject *tmp_type, *tmp_value, *tmp_tb;
24002  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24003  Py_INCREF(tb);
24004  PyErr_Restore(tmp_type, tmp_value, tb);
24005  Py_XDECREF(tmp_tb);
24006 #else
24007  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24008  PyObject* tmp_tb = tstate->curexc_traceback;
24009  if (tb != tmp_tb) {
24010  Py_INCREF(tb);
24011  tstate->curexc_traceback = tb;
24012  Py_XDECREF(tmp_tb);
24013  }
24014 #endif
24015  }
24016 bad:
24017  Py_XDECREF(owned_instance);
24018  return;
24019 }
24020 #endif
24021 
24022 /* PyIntCompare */
24023 static CYTHON_INLINE PyObject* __Pyx_PyInt_NeObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED long inplace) {
24024  if (op1 == op2) {
24025  Py_RETURN_FALSE;
24026  }
24027  #if PY_MAJOR_VERSION < 3
24028  if (likely(PyInt_CheckExact(op1))) {
24029  const long b = intval;
24030  long a = PyInt_AS_LONG(op1);
24031  if (a != b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24032  }
24033  #endif
24034  #if CYTHON_USE_PYLONG_INTERNALS
24035  if (likely(PyLong_CheckExact(op1))) {
24036  int unequal;
24037  unsigned long uintval;
24038  Py_ssize_t size = Py_SIZE(op1);
24039  const digit* digits = ((PyLongObject*)op1)->ob_digit;
24040  if (intval == 0) {
24041  if (size != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24042  } else if (intval < 0) {
24043  if (size >= 0)
24044  Py_RETURN_TRUE;
24045  intval = -intval;
24046  size = -size;
24047  } else {
24048  if (size <= 0)
24049  Py_RETURN_TRUE;
24050  }
24051  uintval = (unsigned long) intval;
24052 #if PyLong_SHIFT * 4 < SIZEOF_LONG*8
24053  if (uintval >> (PyLong_SHIFT * 4)) {
24054  unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24055  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24056  } else
24057 #endif
24058 #if PyLong_SHIFT * 3 < SIZEOF_LONG*8
24059  if (uintval >> (PyLong_SHIFT * 3)) {
24060  unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24061  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24062  } else
24063 #endif
24064 #if PyLong_SHIFT * 2 < SIZEOF_LONG*8
24065  if (uintval >> (PyLong_SHIFT * 2)) {
24066  unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24067  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24068  } else
24069 #endif
24070 #if PyLong_SHIFT * 1 < SIZEOF_LONG*8
24071  if (uintval >> (PyLong_SHIFT * 1)) {
24072  unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
24073  | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
24074  } else
24075 #endif
24076  unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
24077  if (unequal != 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24078  }
24079  #endif
24080  if (PyFloat_CheckExact(op1)) {
24081  const long b = intval;
24082  double a = PyFloat_AS_DOUBLE(op1);
24083  if ((double)a != (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
24084  }
24085  return (
24086  PyObject_RichCompare(op1, op2, Py_NE));
24087 }
24088 
24089 /* BytesEquals */
24090 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
24091 #if CYTHON_COMPILING_IN_PYPY
24092  return PyObject_RichCompareBool(s1, s2, equals);
24093 #else
24094  if (s1 == s2) {
24095  return (equals == Py_EQ);
24096  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
24097  const char *ps1, *ps2;
24098  Py_ssize_t length = PyBytes_GET_SIZE(s1);
24099  if (length != PyBytes_GET_SIZE(s2))
24100  return (equals == Py_NE);
24101  ps1 = PyBytes_AS_STRING(s1);
24102  ps2 = PyBytes_AS_STRING(s2);
24103  if (ps1[0] != ps2[0]) {
24104  return (equals == Py_NE);
24105  } else if (length == 1) {
24106  return (equals == Py_EQ);
24107  } else {
24108  int result;
24109 #if CYTHON_USE_UNICODE_INTERNALS
24110  Py_hash_t hash1, hash2;
24111  hash1 = ((PyBytesObject*)s1)->ob_shash;
24112  hash2 = ((PyBytesObject*)s2)->ob_shash;
24113  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24114  return (equals == Py_NE);
24115  }
24116 #endif
24117  result = memcmp(ps1, ps2, (size_t)length);
24118  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24119  }
24120  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
24121  return (equals == Py_NE);
24122  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
24123  return (equals == Py_NE);
24124  } else {
24125  int result;
24126  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24127  if (!py_result)
24128  return -1;
24129  result = __Pyx_PyObject_IsTrue(py_result);
24130  Py_DECREF(py_result);
24131  return result;
24132  }
24133 #endif
24134 }
24135 
24136 /* PyDictVersioning */
24137 #if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
24138 static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
24139  PyObject *dict = Py_TYPE(obj)->tp_dict;
24140  return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
24141 }
24142 static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
24143  PyObject **dictptr = NULL;
24144  Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
24145  if (offset) {
24146 #if CYTHON_COMPILING_IN_CPYTHON
24147  dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
24148 #else
24149  dictptr = _PyObject_GetDictPtr(obj);
24150 #endif
24151  }
24152  return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
24153 }
24154 static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
24155  PyObject *dict = Py_TYPE(obj)->tp_dict;
24156  if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
24157  return 0;
24158  return obj_dict_version == __Pyx_get_object_dict_version(obj);
24159 }
24160 #endif
24161 
24162 /* GetModuleGlobalName */
24163 #if CYTHON_USE_DICT_VERSIONS
24164 static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
24165 #else
24166 static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
24167 #endif
24168 {
24169  PyObject *result;
24170 #if !CYTHON_AVOID_BORROWED_REFS
24171 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24172  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24173  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24174  if (likely(result)) {
24175  return __Pyx_NewRef(result);
24176  } else if (unlikely(PyErr_Occurred())) {
24177  return NULL;
24178  }
24179 #else
24180  result = PyDict_GetItem(__pyx_d, name);
24181  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24182  if (likely(result)) {
24183  return __Pyx_NewRef(result);
24184  }
24185 #endif
24186 #else
24187  result = PyObject_GetItem(__pyx_d, name);
24188  __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
24189  if (likely(result)) {
24190  return __Pyx_NewRef(result);
24191  }
24192  PyErr_Clear();
24193 #endif
24194  return __Pyx_GetBuiltinName(name);
24195 }
24196 
24197 /* PyCFunctionFastCall */
24198 #if CYTHON_FAST_PYCCALL
24199 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
24200  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
24201  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
24202  PyObject *self = PyCFunction_GET_SELF(func);
24203  int flags = PyCFunction_GET_FLAGS(func);
24204  assert(PyCFunction_Check(func));
24205  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS | METH_STACKLESS)));
24206  assert(nargs >= 0);
24207  assert(nargs == 0 || args != NULL);
24208  /* _PyCFunction_FastCallDict() must not be called with an exception set,
24209  because it may clear it (directly or indirectly) and so the
24210  caller loses its exception */
24211  assert(!PyErr_Occurred());
24212  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
24213  return (*((__Pyx_PyCFunctionFastWithKeywords)(void*)meth)) (self, args, nargs, NULL);
24214  } else {
24215  return (*((__Pyx_PyCFunctionFast)(void*)meth)) (self, args, nargs);
24216  }
24217 }
24218 #endif
24219 
24220 /* PyFunctionFastCall */
24221 #if CYTHON_FAST_PYCALL
24222 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
24223  PyObject *globals) {
24224  PyFrameObject *f;
24225  PyThreadState *tstate = __Pyx_PyThreadState_Current;
24226  PyObject **fastlocals;
24227  Py_ssize_t i;
24228  PyObject *result;
24229  assert(globals != NULL);
24230  /* XXX Perhaps we should create a specialized
24231  PyFrame_New() that doesn't take locals, but does
24232  take builtins without sanity checking them.
24233  */
24234  assert(tstate != NULL);
24235  f = PyFrame_New(tstate, co, globals, NULL);
24236  if (f == NULL) {
24237  return NULL;
24238  }
24239  fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
24240  for (i = 0; i < na; i++) {
24241  Py_INCREF(*args);
24242  fastlocals[i] = *args++;
24243  }
24244  result = PyEval_EvalFrameEx(f,0);
24245  ++tstate->recursion_depth;
24246  Py_DECREF(f);
24247  --tstate->recursion_depth;
24248  return result;
24249 }
24250 #if 1 || PY_VERSION_HEX < 0x030600B1
24251 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
24252  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
24253  PyObject *globals = PyFunction_GET_GLOBALS(func);
24254  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
24255  PyObject *closure;
24256 #if PY_MAJOR_VERSION >= 3
24257  PyObject *kwdefs;
24258 #endif
24259  PyObject *kwtuple, **k;
24260  PyObject **d;
24261  Py_ssize_t nd;
24262  Py_ssize_t nk;
24263  PyObject *result;
24264  assert(kwargs == NULL || PyDict_Check(kwargs));
24265  nk = kwargs ? PyDict_Size(kwargs) : 0;
24266  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
24267  return NULL;
24268  }
24269  if (
24270 #if PY_MAJOR_VERSION >= 3
24271  co->co_kwonlyargcount == 0 &&
24272 #endif
24273  likely(kwargs == NULL || nk == 0) &&
24274  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
24275  if (argdefs == NULL && co->co_argcount == nargs) {
24276  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
24277  goto done;
24278  }
24279  else if (nargs == 0 && argdefs != NULL
24280  && co->co_argcount == Py_SIZE(argdefs)) {
24281  /* function called with no arguments, but all parameters have
24282  a default value: use default values as arguments .*/
24283  args = &PyTuple_GET_ITEM(argdefs, 0);
24284  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
24285  goto done;
24286  }
24287  }
24288  if (kwargs != NULL) {
24289  Py_ssize_t pos, i;
24290  kwtuple = PyTuple_New(2 * nk);
24291  if (kwtuple == NULL) {
24292  result = NULL;
24293  goto done;
24294  }
24295  k = &PyTuple_GET_ITEM(kwtuple, 0);
24296  pos = i = 0;
24297  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
24298  Py_INCREF(k[i]);
24299  Py_INCREF(k[i+1]);
24300  i += 2;
24301  }
24302  nk = i / 2;
24303  }
24304  else {
24305  kwtuple = NULL;
24306  k = NULL;
24307  }
24308  closure = PyFunction_GET_CLOSURE(func);
24309 #if PY_MAJOR_VERSION >= 3
24310  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24311 #endif
24312  if (argdefs != NULL) {
24313  d = &PyTuple_GET_ITEM(argdefs, 0);
24314  nd = Py_SIZE(argdefs);
24315  }
24316  else {
24317  d = NULL;
24318  nd = 0;
24319  }
24320 #if PY_MAJOR_VERSION >= 3
24321  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24322  args, (int)nargs,
24323  k, (int)nk,
24324  d, (int)nd, kwdefs, closure);
24325 #else
24326  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24327  args, (int)nargs,
24328  k, (int)nk,
24329  d, (int)nd, closure);
24330 #endif
24331  Py_XDECREF(kwtuple);
24332 done:
24333  Py_LeaveRecursiveCall();
24334  return result;
24335 }
24336 #endif
24337 #endif
24338 
24339 /* PyObjectCall2Args */
24340 static CYTHON_UNUSED PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
24341  PyObject *args, *result = NULL;
24342  #if CYTHON_FAST_PYCALL
24343  if (PyFunction_Check(function)) {
24344  PyObject *args[2] = {arg1, arg2};
24345  return __Pyx_PyFunction_FastCall(function, args, 2);
24346  }
24347  #endif
24348  #if CYTHON_FAST_PYCCALL
24349  if (__Pyx_PyFastCFunction_Check(function)) {
24350  PyObject *args[2] = {arg1, arg2};
24351  return __Pyx_PyCFunction_FastCall(function, args, 2);
24352  }
24353  #endif
24354  args = PyTuple_New(2);
24355  if (unlikely(!args)) goto done;
24356  Py_INCREF(arg1);
24357  PyTuple_SET_ITEM(args, 0, arg1);
24358  Py_INCREF(arg2);
24359  PyTuple_SET_ITEM(args, 1, arg2);
24360  Py_INCREF(function);
24361  result = __Pyx_PyObject_Call(function, args, NULL);
24362  Py_DECREF(args);
24363  Py_DECREF(function);
24364 done:
24365  return result;
24366 }
24367 
24368 /* PyObjectCallMethO */
24369 #if CYTHON_COMPILING_IN_CPYTHON
24370 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24371  PyObject *self, *result;
24372  PyCFunction cfunc;
24373  cfunc = PyCFunction_GET_FUNCTION(func);
24374  self = PyCFunction_GET_SELF(func);
24375  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24376  return NULL;
24377  result = cfunc(self, arg);
24378  Py_LeaveRecursiveCall();
24379  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24380  PyErr_SetString(
24381  PyExc_SystemError,
24382  "NULL result without error in PyObject_Call");
24383  }
24384  return result;
24385 }
24386 #endif
24387 
24388 /* PyObjectCallOneArg */
24389 #if CYTHON_COMPILING_IN_CPYTHON
24390 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24391  PyObject *result;
24392  PyObject *args = PyTuple_New(1);
24393  if (unlikely(!args)) return NULL;
24394  Py_INCREF(arg);
24395  PyTuple_SET_ITEM(args, 0, arg);
24396  result = __Pyx_PyObject_Call(func, args, NULL);
24397  Py_DECREF(args);
24398  return result;
24399 }
24400 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24401 #if CYTHON_FAST_PYCALL
24402  if (PyFunction_Check(func)) {
24403  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24404  }
24405 #endif
24406  if (likely(PyCFunction_Check(func))) {
24407  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24408  return __Pyx_PyObject_CallMethO(func, arg);
24409 #if CYTHON_FAST_PYCCALL
24410  } else if (__Pyx_PyFastCFunction_Check(func)) {
24411  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24412 #endif
24413  }
24414  }
24415  return __Pyx__PyObject_CallOneArg(func, arg);
24416 }
24417 #else
24418 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24419  PyObject *result;
24420  PyObject *args = PyTuple_Pack(1, arg);
24421  if (unlikely(!args)) return NULL;
24422  result = __Pyx_PyObject_Call(func, args, NULL);
24423  Py_DECREF(args);
24424  return result;
24425 }
24426 #endif
24427 
24428 /* PyObjectCallNoArg */
24429 #if CYTHON_COMPILING_IN_CPYTHON
24430 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24431 #if CYTHON_FAST_PYCALL
24432  if (PyFunction_Check(func)) {
24433  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24434  }
24435 #endif
24436 #ifdef __Pyx_CyFunction_USED
24437  if (likely(PyCFunction_Check(func) || __Pyx_CyFunction_Check(func)))
24438 #else
24439  if (likely(PyCFunction_Check(func)))
24440 #endif
24441  {
24442  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24443  return __Pyx_PyObject_CallMethO(func, NULL);
24444  }
24445  }
24446  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24447 }
24448 #endif
24449 
24450 /* GetItemInt */
24451 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24452  PyObject *r;
24453  if (!j) return NULL;
24454  r = PyObject_GetItem(o, j);
24455  Py_DECREF(j);
24456  return r;
24457 }
24458 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24459  CYTHON_NCP_UNUSED int wraparound,
24460  CYTHON_NCP_UNUSED int boundscheck) {
24461 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24462  Py_ssize_t wrapped_i = i;
24463  if (wraparound & unlikely(i < 0)) {
24464  wrapped_i += PyList_GET_SIZE(o);
24465  }
24466  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
24467  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
24468  Py_INCREF(r);
24469  return r;
24470  }
24471  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24472 #else
24473  return PySequence_GetItem(o, i);
24474 #endif
24475 }
24476 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24477  CYTHON_NCP_UNUSED int wraparound,
24478  CYTHON_NCP_UNUSED int boundscheck) {
24479 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24480  Py_ssize_t wrapped_i = i;
24481  if (wraparound & unlikely(i < 0)) {
24482  wrapped_i += PyTuple_GET_SIZE(o);
24483  }
24484  if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
24485  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
24486  Py_INCREF(r);
24487  return r;
24488  }
24489  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24490 #else
24491  return PySequence_GetItem(o, i);
24492 #endif
24493 }
24494 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
24495  CYTHON_NCP_UNUSED int wraparound,
24496  CYTHON_NCP_UNUSED int boundscheck) {
24497 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
24498  if (is_list || PyList_CheckExact(o)) {
24499  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24500  if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
24501  PyObject *r = PyList_GET_ITEM(o, n);
24502  Py_INCREF(r);
24503  return r;
24504  }
24505  }
24506  else if (PyTuple_CheckExact(o)) {
24507  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24508  if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
24509  PyObject *r = PyTuple_GET_ITEM(o, n);
24510  Py_INCREF(r);
24511  return r;
24512  }
24513  } else {
24514  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24515  if (likely(m && m->sq_item)) {
24516  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24517  Py_ssize_t l = m->sq_length(o);
24518  if (likely(l >= 0)) {
24519  i += l;
24520  } else {
24521  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
24522  return NULL;
24523  PyErr_Clear();
24524  }
24525  }
24526  return m->sq_item(o, i);
24527  }
24528  }
24529 #else
24530  if (is_list || PySequence_Check(o)) {
24531  return PySequence_GetItem(o, i);
24532  }
24533 #endif
24534  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24535 }
24536 
24537 /* DictGetItem */
24538 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
24539 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
24540  PyObject *value;
24541  value = PyDict_GetItemWithError(d, key);
24542  if (unlikely(!value)) {
24543  if (!PyErr_Occurred()) {
24544  if (unlikely(PyTuple_Check(key))) {
24545  PyObject* args = PyTuple_Pack(1, key);
24546  if (likely(args)) {
24547  PyErr_SetObject(PyExc_KeyError, args);
24548  Py_DECREF(args);
24549  }
24550  } else {
24551  PyErr_SetObject(PyExc_KeyError, key);
24552  }
24553  }
24554  return NULL;
24555  }
24556  Py_INCREF(value);
24557  return value;
24558 }
24559 #endif
24560 
24561 /* MemviewSliceInit */
24562 static int
24563 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
24564  int ndim,
24565  __Pyx_memviewslice *memviewslice,
24566  int memview_is_new_reference)
24567 {
24568  __Pyx_RefNannyDeclarations
24569  int i, retval=-1;
24570  Py_buffer *buf = &memview->view;
24571  __Pyx_RefNannySetupContext("init_memviewslice", 0);
24572  if (unlikely(memviewslice->memview || memviewslice->data)) {
24573  PyErr_SetString(PyExc_ValueError,
24574  "memviewslice is already initialized!");
24575  goto fail;
24576  }
24577  if (buf->strides) {
24578  for (i = 0; i < ndim; i++) {
24579  memviewslice->strides[i] = buf->strides[i];
24580  }
24581  } else {
24582  Py_ssize_t stride = buf->itemsize;
24583  for (i = ndim - 1; i >= 0; i--) {
24584  memviewslice->strides[i] = stride;
24585  stride *= buf->shape[i];
24586  }
24587  }
24588  for (i = 0; i < ndim; i++) {
24589  memviewslice->shape[i] = buf->shape[i];
24590  if (buf->suboffsets) {
24591  memviewslice->suboffsets[i] = buf->suboffsets[i];
24592  } else {
24593  memviewslice->suboffsets[i] = -1;
24594  }
24595  }
24596  memviewslice->memview = memview;
24597  memviewslice->data = (char *)buf->buf;
24598  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
24599  Py_INCREF(memview);
24600  }
24601  retval = 0;
24602  goto no_fail;
24603 fail:
24604  memviewslice->memview = 0;
24605  memviewslice->data = 0;
24606  retval = -1;
24607 no_fail:
24608  __Pyx_RefNannyFinishContext();
24609  return retval;
24610 }
24611 #ifndef Py_NO_RETURN
24612 #define Py_NO_RETURN
24613 #endif
24614 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
24615  va_list vargs;
24616  char msg[200];
24617 #ifdef HAVE_STDARG_PROTOTYPES
24618  va_start(vargs, fmt);
24619 #else
24620  va_start(vargs);
24621 #endif
24622  vsnprintf(msg, 200, fmt, vargs);
24623  va_end(vargs);
24624  Py_FatalError(msg);
24625 }
24626 static CYTHON_INLINE int
24627 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24628  PyThread_type_lock lock)
24629 {
24630  int result;
24631  PyThread_acquire_lock(lock, 1);
24632  result = (*acquisition_count)++;
24633  PyThread_release_lock(lock);
24634  return result;
24635 }
24636 static CYTHON_INLINE int
24637 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
24638  PyThread_type_lock lock)
24639 {
24640  int result;
24641  PyThread_acquire_lock(lock, 1);
24642  result = (*acquisition_count)--;
24643  PyThread_release_lock(lock);
24644  return result;
24645 }
24646 static CYTHON_INLINE void
24647 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
24648 {
24649  int first_time;
24650  struct __pyx_memoryview_obj *memview = memslice->memview;
24651  if (unlikely(!memview || (PyObject *) memview == Py_None))
24652  return;
24653  if (unlikely(__pyx_get_slice_count(memview) < 0))
24654  __pyx_fatalerror("Acquisition count is %d (line %d)",
24655  __pyx_get_slice_count(memview), lineno);
24656  first_time = __pyx_add_acquisition_count(memview) == 0;
24657  if (unlikely(first_time)) {
24658  if (have_gil) {
24659  Py_INCREF((PyObject *) memview);
24660  } else {
24661  PyGILState_STATE _gilstate = PyGILState_Ensure();
24662  Py_INCREF((PyObject *) memview);
24663  PyGILState_Release(_gilstate);
24664  }
24665  }
24666 }
24667 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
24668  int have_gil, int lineno) {
24669  int last_time;
24670  struct __pyx_memoryview_obj *memview = memslice->memview;
24671  if (unlikely(!memview || (PyObject *) memview == Py_None)) {
24672  memslice->memview = NULL;
24673  return;
24674  }
24675  if (unlikely(__pyx_get_slice_count(memview) <= 0))
24676  __pyx_fatalerror("Acquisition count is %d (line %d)",
24677  __pyx_get_slice_count(memview), lineno);
24678  last_time = __pyx_sub_acquisition_count(memview) == 1;
24679  memslice->data = NULL;
24680  if (unlikely(last_time)) {
24681  if (have_gil) {
24682  Py_CLEAR(memslice->memview);
24683  } else {
24684  PyGILState_STATE _gilstate = PyGILState_Ensure();
24685  Py_CLEAR(memslice->memview);
24686  PyGILState_Release(_gilstate);
24687  }
24688  } else {
24689  memslice->memview = NULL;
24690  }
24691 }
24692 
24693 /* ArgTypeTest */
24694 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
24695 {
24696  if (unlikely(!type)) {
24697  PyErr_SetString(PyExc_SystemError, "Missing type object");
24698  return 0;
24699  }
24700  else if (exact) {
24701  #if PY_MAJOR_VERSION == 2
24702  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
24703  #endif
24704  }
24705  else {
24706  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
24707  }
24708  PyErr_Format(PyExc_TypeError,
24709  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
24710  name, type->tp_name, Py_TYPE(obj)->tp_name);
24711  return 0;
24712 }
24713 
24714 /* UnicodeEquals */
24715 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
24716 #if CYTHON_COMPILING_IN_PYPY
24717  return PyObject_RichCompareBool(s1, s2, equals);
24718 #else
24719 #if PY_MAJOR_VERSION < 3
24720  PyObject* owned_ref = NULL;
24721 #endif
24722  int s1_is_unicode, s2_is_unicode;
24723  if (s1 == s2) {
24724  goto return_eq;
24725  }
24726  s1_is_unicode = PyUnicode_CheckExact(s1);
24727  s2_is_unicode = PyUnicode_CheckExact(s2);
24728 #if PY_MAJOR_VERSION < 3
24729  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
24730  owned_ref = PyUnicode_FromObject(s2);
24731  if (unlikely(!owned_ref))
24732  return -1;
24733  s2 = owned_ref;
24734  s2_is_unicode = 1;
24735  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
24736  owned_ref = PyUnicode_FromObject(s1);
24737  if (unlikely(!owned_ref))
24738  return -1;
24739  s1 = owned_ref;
24740  s1_is_unicode = 1;
24741  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
24742  return __Pyx_PyBytes_Equals(s1, s2, equals);
24743  }
24744 #endif
24745  if (s1_is_unicode & s2_is_unicode) {
24746  Py_ssize_t length;
24747  int kind;
24748  void *data1, *data2;
24749  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
24750  return -1;
24751  length = __Pyx_PyUnicode_GET_LENGTH(s1);
24752  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
24753  goto return_ne;
24754  }
24755 #if CYTHON_USE_UNICODE_INTERNALS
24756  {
24757  Py_hash_t hash1, hash2;
24758  #if CYTHON_PEP393_ENABLED
24759  hash1 = ((PyASCIIObject*)s1)->hash;
24760  hash2 = ((PyASCIIObject*)s2)->hash;
24761  #else
24762  hash1 = ((PyUnicodeObject*)s1)->hash;
24763  hash2 = ((PyUnicodeObject*)s2)->hash;
24764  #endif
24765  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
24766  goto return_ne;
24767  }
24768  }
24769 #endif
24770  kind = __Pyx_PyUnicode_KIND(s1);
24771  if (kind != __Pyx_PyUnicode_KIND(s2)) {
24772  goto return_ne;
24773  }
24774  data1 = __Pyx_PyUnicode_DATA(s1);
24775  data2 = __Pyx_PyUnicode_DATA(s2);
24776  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
24777  goto return_ne;
24778  } else if (length == 1) {
24779  goto return_eq;
24780  } else {
24781  int result = memcmp(data1, data2, (size_t)(length * kind));
24782  #if PY_MAJOR_VERSION < 3
24783  Py_XDECREF(owned_ref);
24784  #endif
24785  return (equals == Py_EQ) ? (result == 0) : (result != 0);
24786  }
24787  } else if ((s1 == Py_None) & s2_is_unicode) {
24788  goto return_ne;
24789  } else if ((s2 == Py_None) & s1_is_unicode) {
24790  goto return_ne;
24791  } else {
24792  int result;
24793  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
24794  #if PY_MAJOR_VERSION < 3
24795  Py_XDECREF(owned_ref);
24796  #endif
24797  if (!py_result)
24798  return -1;
24799  result = __Pyx_PyObject_IsTrue(py_result);
24800  Py_DECREF(py_result);
24801  return result;
24802  }
24803 return_eq:
24804  #if PY_MAJOR_VERSION < 3
24805  Py_XDECREF(owned_ref);
24806  #endif
24807  return (equals == Py_EQ);
24808 return_ne:
24809  #if PY_MAJOR_VERSION < 3
24810  Py_XDECREF(owned_ref);
24811  #endif
24812  return (equals == Py_NE);
24813 #endif
24814 }
24815 
24816 /* WriteUnraisableException */
24817 static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24818  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24819  int full_traceback, CYTHON_UNUSED int nogil) {
24820  PyObject *old_exc, *old_val, *old_tb;
24821  PyObject *ctx;
24822  __Pyx_PyThreadState_declare
24823 #ifdef WITH_THREAD
24824  PyGILState_STATE state;
24825  if (nogil)
24826  state = PyGILState_Ensure();
24827 #ifdef _MSC_VER
24828  else state = (PyGILState_STATE)-1;
24829 #endif
24830 #endif
24831  __Pyx_PyThreadState_assign
24832  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24833  if (full_traceback) {
24834  Py_XINCREF(old_exc);
24835  Py_XINCREF(old_val);
24836  Py_XINCREF(old_tb);
24837  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24838  PyErr_PrintEx(1);
24839  }
24840  #if PY_MAJOR_VERSION < 3
24841  ctx = PyString_FromString(name);
24842  #else
24843  ctx = PyUnicode_FromString(name);
24844  #endif
24845  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24846  if (!ctx) {
24847  PyErr_WriteUnraisable(Py_None);
24848  } else {
24849  PyErr_WriteUnraisable(ctx);
24850  Py_DECREF(ctx);
24851  }
24852 #ifdef WITH_THREAD
24853  if (nogil)
24854  PyGILState_Release(state);
24855 #endif
24856 }
24857 
24858 /* GetAttr */
24859 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24860 #if CYTHON_USE_TYPE_SLOTS
24861 #if PY_MAJOR_VERSION >= 3
24862  if (likely(PyUnicode_Check(n)))
24863 #else
24864  if (likely(PyString_Check(n)))
24865 #endif
24866  return __Pyx_PyObject_GetAttrStr(o, n);
24867 #endif
24868  return PyObject_GetAttr(o, n);
24869 }
24870 
24871 /* ObjectGetItem */
24872 #if CYTHON_USE_TYPE_SLOTS
24873 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
24874  PyObject *runerr;
24875  Py_ssize_t key_value;
24876  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
24877  if (unlikely(!(m && m->sq_item))) {
24878  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
24879  return NULL;
24880  }
24881  key_value = __Pyx_PyIndex_AsSsize_t(index);
24882  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
24883  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
24884  }
24885  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
24886  PyErr_Clear();
24887  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
24888  }
24889  return NULL;
24890 }
24891 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
24892  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
24893  if (likely(m && m->mp_subscript)) {
24894  return m->mp_subscript(obj, key);
24895  }
24896  return __Pyx_PyObject_GetIndex(obj, key);
24897 }
24898 #endif
24899 
24900 /* decode_c_string */
24901 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
24902  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
24903  const char* encoding, const char* errors,
24904  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
24905  Py_ssize_t length;
24906  if (unlikely((start < 0) | (stop < 0))) {
24907  size_t slen = strlen(cstring);
24908  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
24909  PyErr_SetString(PyExc_OverflowError,
24910  "c-string too long to convert to Python");
24911  return NULL;
24912  }
24913  length = (Py_ssize_t) slen;
24914  if (start < 0) {
24915  start += length;
24916  if (start < 0)
24917  start = 0;
24918  }
24919  if (stop < 0)
24920  stop += length;
24921  }
24922  if (unlikely(stop <= start))
24923  return __Pyx_NewRef(__pyx_empty_unicode);
24924  length = stop - start;
24925  cstring += start;
24926  if (decode_func) {
24927  return decode_func(cstring, length, errors);
24928  } else {
24929  return PyUnicode_Decode(cstring, length, encoding, errors);
24930  }
24931 }
24932 
24933 /* PyErrExceptionMatches */
24934 #if CYTHON_FAST_THREAD_STATE
24935 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24936  Py_ssize_t i, n;
24937  n = PyTuple_GET_SIZE(tuple);
24938 #if PY_MAJOR_VERSION >= 3
24939  for (i=0; i<n; i++) {
24940  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24941  }
24942 #endif
24943  for (i=0; i<n; i++) {
24944  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24945  }
24946  return 0;
24947 }
24948 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24949  PyObject *exc_type = tstate->curexc_type;
24950  if (exc_type == err) return 1;
24951  if (unlikely(!exc_type)) return 0;
24952  if (unlikely(PyTuple_Check(err)))
24953  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24954  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24955 }
24956 #endif
24957 
24958 /* GetAttr3 */
24959 static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24960  __Pyx_PyThreadState_declare
24961  __Pyx_PyThreadState_assign
24962  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24963  return NULL;
24964  __Pyx_PyErr_Clear();
24965  Py_INCREF(d);
24966  return d;
24967 }
24968 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24969  PyObject *r = __Pyx_GetAttr(o, n);
24970  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24971 }
24972 
24973 /* RaiseTooManyValuesToUnpack */
24974 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24975  PyErr_Format(PyExc_ValueError,
24976  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
24977 }
24978 
24979 /* RaiseNeedMoreValuesToUnpack */
24980 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24981  PyErr_Format(PyExc_ValueError,
24982  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
24983  index, (index == 1) ? "" : "s");
24984 }
24985 
24986 /* RaiseNoneIterError */
24987 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
24988  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
24989 }
24990 
24991 /* ExtTypeTest */
24992 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24993  if (unlikely(!type)) {
24994  PyErr_SetString(PyExc_SystemError, "Missing type object");
24995  return 0;
24996  }
24997  if (likely(__Pyx_TypeCheck(obj, type)))
24998  return 1;
24999  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25000  Py_TYPE(obj)->tp_name, type->tp_name);
25001  return 0;
25002 }
25003 
25004 /* GetTopmostException */
25005 #if CYTHON_USE_EXC_INFO_STACK
25006 static _PyErr_StackItem *
25007 __Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
25008 {
25009  _PyErr_StackItem *exc_info = tstate->exc_info;
25010  while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
25011  exc_info->previous_item != NULL)
25012  {
25013  exc_info = exc_info->previous_item;
25014  }
25015  return exc_info;
25016 }
25017 #endif
25018 
25019 /* SaveResetException */
25020 #if CYTHON_FAST_THREAD_STATE
25021 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25022  #if CYTHON_USE_EXC_INFO_STACK
25023  _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
25024  *type = exc_info->exc_type;
25025  *value = exc_info->exc_value;
25026  *tb = exc_info->exc_traceback;
25027  #else
25028  *type = tstate->exc_type;
25029  *value = tstate->exc_value;
25030  *tb = tstate->exc_traceback;
25031  #endif
25032  Py_XINCREF(*type);
25033  Py_XINCREF(*value);
25034  Py_XINCREF(*tb);
25035 }
25036 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25037  PyObject *tmp_type, *tmp_value, *tmp_tb;
25038  #if CYTHON_USE_EXC_INFO_STACK
25039  _PyErr_StackItem *exc_info = tstate->exc_info;
25040  tmp_type = exc_info->exc_type;
25041  tmp_value = exc_info->exc_value;
25042  tmp_tb = exc_info->exc_traceback;
25043  exc_info->exc_type = type;
25044  exc_info->exc_value = value;
25045  exc_info->exc_traceback = tb;
25046  #else
25047  tmp_type = tstate->exc_type;
25048  tmp_value = tstate->exc_value;
25049  tmp_tb = tstate->exc_traceback;
25050  tstate->exc_type = type;
25051  tstate->exc_value = value;
25052  tstate->exc_traceback = tb;
25053  #endif
25054  Py_XDECREF(tmp_type);
25055  Py_XDECREF(tmp_value);
25056  Py_XDECREF(tmp_tb);
25057 }
25058 #endif
25059 
25060 /* GetException */
25061 #if CYTHON_FAST_THREAD_STATE
25062 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
25063 #else
25064 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
25065 #endif
25066 {
25067  PyObject *local_type, *local_value, *local_tb;
25068 #if CYTHON_FAST_THREAD_STATE
25069  PyObject *tmp_type, *tmp_value, *tmp_tb;
25070  local_type = tstate->curexc_type;
25071  local_value = tstate->curexc_value;
25072  local_tb = tstate->curexc_traceback;
25073  tstate->curexc_type = 0;
25074  tstate->curexc_value = 0;
25075  tstate->curexc_traceback = 0;
25076 #else
25077  PyErr_Fetch(&local_type, &local_value, &local_tb);
25078 #endif
25079  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25080 #if CYTHON_FAST_THREAD_STATE
25081  if (unlikely(tstate->curexc_type))
25082 #else
25083  if (unlikely(PyErr_Occurred()))
25084 #endif
25085  goto bad;
25086  #if PY_MAJOR_VERSION >= 3
25087  if (local_tb) {
25088  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25089  goto bad;
25090  }
25091  #endif
25092  Py_XINCREF(local_tb);
25093  Py_XINCREF(local_type);
25094  Py_XINCREF(local_value);
25095  *type = local_type;
25096  *value = local_value;
25097  *tb = local_tb;
25098 #if CYTHON_FAST_THREAD_STATE
25099  #if CYTHON_USE_EXC_INFO_STACK
25100  {
25101  _PyErr_StackItem *exc_info = tstate->exc_info;
25102  tmp_type = exc_info->exc_type;
25103  tmp_value = exc_info->exc_value;
25104  tmp_tb = exc_info->exc_traceback;
25105  exc_info->exc_type = local_type;
25106  exc_info->exc_value = local_value;
25107  exc_info->exc_traceback = local_tb;
25108  }
25109  #else
25110  tmp_type = tstate->exc_type;
25111  tmp_value = tstate->exc_value;
25112  tmp_tb = tstate->exc_traceback;
25113  tstate->exc_type = local_type;
25114  tstate->exc_value = local_value;
25115  tstate->exc_traceback = local_tb;
25116  #endif
25117  Py_XDECREF(tmp_type);
25118  Py_XDECREF(tmp_value);
25119  Py_XDECREF(tmp_tb);
25120 #else
25121  PyErr_SetExcInfo(local_type, local_value, local_tb);
25122 #endif
25123  return 0;
25124 bad:
25125  *type = 0;
25126  *value = 0;
25127  *tb = 0;
25128  Py_XDECREF(local_type);
25129  Py_XDECREF(local_value);
25130  Py_XDECREF(local_tb);
25131  return -1;
25132 }
25133 
25134 /* SwapException */
25135 #if CYTHON_FAST_THREAD_STATE
25136 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25137  PyObject *tmp_type, *tmp_value, *tmp_tb;
25138  #if CYTHON_USE_EXC_INFO_STACK
25139  _PyErr_StackItem *exc_info = tstate->exc_info;
25140  tmp_type = exc_info->exc_type;
25141  tmp_value = exc_info->exc_value;
25142  tmp_tb = exc_info->exc_traceback;
25143  exc_info->exc_type = *type;
25144  exc_info->exc_value = *value;
25145  exc_info->exc_traceback = *tb;
25146  #else
25147  tmp_type = tstate->exc_type;
25148  tmp_value = tstate->exc_value;
25149  tmp_tb = tstate->exc_traceback;
25150  tstate->exc_type = *type;
25151  tstate->exc_value = *value;
25152  tstate->exc_traceback = *tb;
25153  #endif
25154  *type = tmp_type;
25155  *value = tmp_value;
25156  *tb = tmp_tb;
25157 }
25158 #else
25159 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25160  PyObject *tmp_type, *tmp_value, *tmp_tb;
25161  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25162  PyErr_SetExcInfo(*type, *value, *tb);
25163  *type = tmp_type;
25164  *value = tmp_value;
25165  *tb = tmp_tb;
25166 }
25167 #endif
25168 
25169 /* Import */
25170 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
25171  PyObject *empty_list = 0;
25172  PyObject *module = 0;
25173  PyObject *global_dict = 0;
25174  PyObject *empty_dict = 0;
25175  PyObject *list;
25176  #if PY_MAJOR_VERSION < 3
25177  PyObject *py_import;
25178  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
25179  if (!py_import)
25180  goto bad;
25181  #endif
25182  if (from_list)
25183  list = from_list;
25184  else {
25185  empty_list = PyList_New(0);
25186  if (!empty_list)
25187  goto bad;
25188  list = empty_list;
25189  }
25190  global_dict = PyModule_GetDict(__pyx_m);
25191  if (!global_dict)
25192  goto bad;
25193  empty_dict = PyDict_New();
25194  if (!empty_dict)
25195  goto bad;
25196  {
25197  #if PY_MAJOR_VERSION >= 3
25198  if (level == -1) {
25199  if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
25200  module = PyImport_ImportModuleLevelObject(
25201  name, global_dict, empty_dict, list, 1);
25202  if (!module) {
25203  if (!PyErr_ExceptionMatches(PyExc_ImportError))
25204  goto bad;
25205  PyErr_Clear();
25206  }
25207  }
25208  level = 0;
25209  }
25210  #endif
25211  if (!module) {
25212  #if PY_MAJOR_VERSION < 3
25213  PyObject *py_level = PyInt_FromLong(level);
25214  if (!py_level)
25215  goto bad;
25216  module = PyObject_CallFunctionObjArgs(py_import,
25217  name, global_dict, empty_dict, list, py_level, (PyObject *)NULL);
25218  Py_DECREF(py_level);
25219  #else
25220  module = PyImport_ImportModuleLevelObject(
25221  name, global_dict, empty_dict, list, level);
25222  #endif
25223  }
25224  }
25225 bad:
25226  #if PY_MAJOR_VERSION < 3
25227  Py_XDECREF(py_import);
25228  #endif
25229  Py_XDECREF(empty_list);
25230  Py_XDECREF(empty_dict);
25231  return module;
25232 }
25233 
25234 /* FastTypeChecks */
25235 #if CYTHON_COMPILING_IN_CPYTHON
25236 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25237  while (a) {
25238  a = a->tp_base;
25239  if (a == b)
25240  return 1;
25241  }
25242  return b == &PyBaseObject_Type;
25243 }
25244 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25245  PyObject *mro;
25246  if (a == b) return 1;
25247  mro = a->tp_mro;
25248  if (likely(mro)) {
25249  Py_ssize_t i, n;
25250  n = PyTuple_GET_SIZE(mro);
25251  for (i = 0; i < n; i++) {
25252  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25253  return 1;
25254  }
25255  return 0;
25256  }
25257  return __Pyx_InBases(a, b);
25258 }
25259 #if PY_MAJOR_VERSION == 2
25260 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25261  PyObject *exception, *value, *tb;
25262  int res;
25263  __Pyx_PyThreadState_declare
25264  __Pyx_PyThreadState_assign
25265  __Pyx_ErrFetch(&exception, &value, &tb);
25266  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25267  if (unlikely(res == -1)) {
25268  PyErr_WriteUnraisable(err);
25269  res = 0;
25270  }
25271  if (!res) {
25272  res = PyObject_IsSubclass(err, exc_type2);
25273  if (unlikely(res == -1)) {
25274  PyErr_WriteUnraisable(err);
25275  res = 0;
25276  }
25277  }
25278  __Pyx_ErrRestore(exception, value, tb);
25279  return res;
25280 }
25281 #else
25282 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25283  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25284  if (!res) {
25285  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25286  }
25287  return res;
25288 }
25289 #endif
25290 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25291  Py_ssize_t i, n;
25292  assert(PyExceptionClass_Check(exc_type));
25293  n = PyTuple_GET_SIZE(tuple);
25294 #if PY_MAJOR_VERSION >= 3
25295  for (i=0; i<n; i++) {
25296  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25297  }
25298 #endif
25299  for (i=0; i<n; i++) {
25300  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25301  #if PY_MAJOR_VERSION < 3
25302  if (likely(exc_type == t)) return 1;
25303  #endif
25304  if (likely(PyExceptionClass_Check(t))) {
25305  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25306  } else {
25307  }
25308  }
25309  return 0;
25310 }
25311 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25312  if (likely(err == exc_type)) return 1;
25313  if (likely(PyExceptionClass_Check(err))) {
25314  if (likely(PyExceptionClass_Check(exc_type))) {
25315  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25316  } else if (likely(PyTuple_Check(exc_type))) {
25317  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25318  } else {
25319  }
25320  }
25321  return PyErr_GivenExceptionMatches(err, exc_type);
25322 }
25323 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25324  assert(PyExceptionClass_Check(exc_type1));
25325  assert(PyExceptionClass_Check(exc_type2));
25326  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25327  if (likely(PyExceptionClass_Check(err))) {
25328  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25329  }
25330  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25331 }
25332 #endif
25333 
25334 /* PyIntBinop */
25335 #if !CYTHON_COMPILING_IN_PYPY
25336 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, int inplace, int zerodivision_check) {
25337  (void)inplace;
25338  (void)zerodivision_check;
25339  #if PY_MAJOR_VERSION < 3
25340  if (likely(PyInt_CheckExact(op1))) {
25341  const long b = intval;
25342  long x;
25343  long a = PyInt_AS_LONG(op1);
25344  x = (long)((unsigned long)a + b);
25345  if (likely((x^a) >= 0 || (x^b) >= 0))
25346  return PyInt_FromLong(x);
25347  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25348  }
25349  #endif
25350  #if CYTHON_USE_PYLONG_INTERNALS
25351  if (likely(PyLong_CheckExact(op1))) {
25352  const long b = intval;
25353  long a, x;
25354 #ifdef HAVE_LONG_LONG
25355  const PY_LONG_LONG llb = intval;
25356  PY_LONG_LONG lla, llx;
25357 #endif
25358  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25359  const Py_ssize_t size = Py_SIZE(op1);
25360  if (likely(__Pyx_sst_abs(size) <= 1)) {
25361  a = likely(size) ? digits[0] : 0;
25362  if (size == -1) a = -a;
25363  } else {
25364  switch (size) {
25365  case -2:
25366  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25367  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25368  break;
25369 #ifdef HAVE_LONG_LONG
25370  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25371  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25372  goto long_long;
25373 #endif
25374  }
25375  CYTHON_FALLTHROUGH;
25376  case 2:
25377  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25378  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25379  break;
25380 #ifdef HAVE_LONG_LONG
25381  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25382  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25383  goto long_long;
25384 #endif
25385  }
25386  CYTHON_FALLTHROUGH;
25387  case -3:
25388  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25389  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25390  break;
25391 #ifdef HAVE_LONG_LONG
25392  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25393  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25394  goto long_long;
25395 #endif
25396  }
25397  CYTHON_FALLTHROUGH;
25398  case 3:
25399  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25400  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25401  break;
25402 #ifdef HAVE_LONG_LONG
25403  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25404  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25405  goto long_long;
25406 #endif
25407  }
25408  CYTHON_FALLTHROUGH;
25409  case -4:
25410  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25411  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25412  break;
25413 #ifdef HAVE_LONG_LONG
25414  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25415  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25416  goto long_long;
25417 #endif
25418  }
25419  CYTHON_FALLTHROUGH;
25420  case 4:
25421  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25422  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25423  break;
25424 #ifdef HAVE_LONG_LONG
25425  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25426  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25427  goto long_long;
25428 #endif
25429  }
25430  CYTHON_FALLTHROUGH;
25431  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25432  }
25433  }
25434  x = a + b;
25435  return PyLong_FromLong(x);
25436 #ifdef HAVE_LONG_LONG
25437  long_long:
25438  llx = lla + llb;
25439  return PyLong_FromLongLong(llx);
25440 #endif
25441 
25442 
25443  }
25444  #endif
25445  if (PyFloat_CheckExact(op1)) {
25446  const long b = intval;
25447  double a = PyFloat_AS_DOUBLE(op1);
25448  double result;
25449  PyFPE_START_PROTECT("add", return NULL)
25450  result = ((double)a) + (double)b;
25451  PyFPE_END_PROTECT(result)
25452  return PyFloat_FromDouble(result);
25453  }
25454  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25455 }
25456 #endif
25457 
25458 /* None */
25459 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25460  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25461 }
25462 
25463 /* ImportFrom */
25464 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
25465  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
25466  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
25467  PyErr_Format(PyExc_ImportError,
25468  #if PY_MAJOR_VERSION < 3
25469  "cannot import name %.230s", PyString_AS_STRING(name));
25470  #else
25471  "cannot import name %S", name);
25472  #endif
25473  }
25474  return value;
25475 }
25476 
25477 /* HasAttr */
25478 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25479  PyObject *r;
25480  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25481  PyErr_SetString(PyExc_TypeError,
25482  "hasattr(): attribute name must be string");
25483  return -1;
25484  }
25485  r = __Pyx_GetAttr(o, n);
25486  if (unlikely(!r)) {
25487  PyErr_Clear();
25488  return 0;
25489  } else {
25490  Py_DECREF(r);
25491  return 1;
25492  }
25493 }
25494 
25495 /* CallNextTpDealloc */
25496 static void __Pyx_call_next_tp_dealloc(PyObject* obj, destructor current_tp_dealloc) {
25497  PyTypeObject* type = Py_TYPE(obj);
25498  while (type && type->tp_dealloc != current_tp_dealloc)
25499  type = type->tp_base;
25500  while (type && type->tp_dealloc == current_tp_dealloc)
25501  type = type->tp_base;
25502  if (type)
25503  type->tp_dealloc(obj);
25504 }
25505 
25506 /* CallNextTpTraverse */
25507 static int __Pyx_call_next_tp_traverse(PyObject* obj, visitproc v, void *a, traverseproc current_tp_traverse) {
25508  PyTypeObject* type = Py_TYPE(obj);
25509  while (type && type->tp_traverse != current_tp_traverse)
25510  type = type->tp_base;
25511  while (type && type->tp_traverse == current_tp_traverse)
25512  type = type->tp_base;
25513  if (type && type->tp_traverse)
25514  return type->tp_traverse(obj, v, a);
25515  return 0;
25516 }
25517 
25518 /* CallNextTpClear */
25519 static void __Pyx_call_next_tp_clear(PyObject* obj, inquiry current_tp_clear) {
25520  PyTypeObject* type = Py_TYPE(obj);
25521  while (type && type->tp_clear != current_tp_clear)
25522  type = type->tp_base;
25523  while (type && type->tp_clear == current_tp_clear)
25524  type = type->tp_base;
25525  if (type && type->tp_clear)
25526  type->tp_clear(obj);
25527 }
25528 
25529 /* PyObject_GenericGetAttrNoDict */
25530 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25531 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25532  PyErr_Format(PyExc_AttributeError,
25533 #if PY_MAJOR_VERSION >= 3
25534  "'%.50s' object has no attribute '%U'",
25535  tp->tp_name, attr_name);
25536 #else
25537  "'%.50s' object has no attribute '%.400s'",
25538  tp->tp_name, PyString_AS_STRING(attr_name));
25539 #endif
25540  return NULL;
25541 }
25542 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25543  PyObject *descr;
25544  PyTypeObject *tp = Py_TYPE(obj);
25545  if (unlikely(!PyString_Check(attr_name))) {
25546  return PyObject_GenericGetAttr(obj, attr_name);
25547  }
25548  assert(!tp->tp_dictoffset);
25549  descr = _PyType_Lookup(tp, attr_name);
25550  if (unlikely(!descr)) {
25551  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25552  }
25553  Py_INCREF(descr);
25554  #if PY_MAJOR_VERSION < 3
25555  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25556  #endif
25557  {
25558  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25559  if (unlikely(f)) {
25560  PyObject *res = f(descr, obj, (PyObject *)tp);
25561  Py_DECREF(descr);
25562  return res;
25563  }
25564  }
25565  return descr;
25566 }
25567 #endif
25568 
25569 /* PyObject_GenericGetAttr */
25570 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25571 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25572  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25573  return PyObject_GenericGetAttr(obj, attr_name);
25574  }
25575  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25576 }
25577 #endif
25578 
25579 /* TypeImport */
25580 #ifndef __PYX_HAVE_RT_ImportType
25581 #define __PYX_HAVE_RT_ImportType
25582 static PyTypeObject *__Pyx_ImportType(PyObject *module, const char *module_name, const char *class_name,
25583  size_t size, enum __Pyx_ImportType_CheckSize check_size)
25584 {
25585  PyObject *result = 0;
25586  char warning[200];
25587  Py_ssize_t basicsize;
25588 #ifdef Py_LIMITED_API
25589  PyObject *py_basicsize;
25590 #endif
25591  result = PyObject_GetAttrString(module, class_name);
25592  if (!result)
25593  goto bad;
25594  if (!PyType_Check(result)) {
25595  PyErr_Format(PyExc_TypeError,
25596  "%.200s.%.200s is not a type object",
25597  module_name, class_name);
25598  goto bad;
25599  }
25600 #ifndef Py_LIMITED_API
25601  basicsize = ((PyTypeObject *)result)->tp_basicsize;
25602 #else
25603  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
25604  if (!py_basicsize)
25605  goto bad;
25606  basicsize = PyLong_AsSsize_t(py_basicsize);
25607  Py_DECREF(py_basicsize);
25608  py_basicsize = 0;
25609  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25610  goto bad;
25611 #endif
25612  if ((size_t)basicsize < size) {
25613  PyErr_Format(PyExc_ValueError,
25614  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25615  "Expected %zd from C header, got %zd from PyObject",
25616  module_name, class_name, size, basicsize);
25617  goto bad;
25618  }
25619  if (check_size == __Pyx_ImportType_CheckSize_Error && (size_t)basicsize != size) {
25620  PyErr_Format(PyExc_ValueError,
25621  "%.200s.%.200s size changed, may indicate binary incompatibility. "
25622  "Expected %zd from C header, got %zd from PyObject",
25623  module_name, class_name, size, basicsize);
25624  goto bad;
25625  }
25626  else if (check_size == __Pyx_ImportType_CheckSize_Warn && (size_t)basicsize > size) {
25627  PyOS_snprintf(warning, sizeof(warning),
25628  "%s.%s size changed, may indicate binary incompatibility. "
25629  "Expected %zd from C header, got %zd from PyObject",
25630  module_name, class_name, size, basicsize);
25631  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
25632  }
25633  return (PyTypeObject *)result;
25634 bad:
25635  Py_XDECREF(result);
25636  return NULL;
25637 }
25638 #endif
25639 
25640 /* GetVTable */
25641 static void* __Pyx_GetVtable(PyObject *dict) {
25642  void* ptr;
25643  PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
25644  if (!ob)
25645  goto bad;
25646 #if PY_VERSION_HEX >= 0x02070000
25647  ptr = PyCapsule_GetPointer(ob, 0);
25648 #else
25649  ptr = PyCObject_AsVoidPtr(ob);
25650 #endif
25651  if (!ptr && !PyErr_Occurred())
25652  PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
25653  Py_DECREF(ob);
25654  return ptr;
25655 bad:
25656  Py_XDECREF(ob);
25657  return NULL;
25658 }
25659 
25660 /* SetVTable */
25661 static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25662 #if PY_VERSION_HEX >= 0x02070000
25663  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25664 #else
25665  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25666 #endif
25667  if (!ob)
25668  goto bad;
25669  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25670  goto bad;
25671  Py_DECREF(ob);
25672  return 0;
25673 bad:
25674  Py_XDECREF(ob);
25675  return -1;
25676 }
25677 
25678 /* PyObjectGetAttrStrNoError */
25679 static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
25680  __Pyx_PyThreadState_declare
25681  __Pyx_PyThreadState_assign
25682  if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
25683  __Pyx_PyErr_Clear();
25684 }
25685 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
25686  PyObject *result;
25687 #if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
25688  PyTypeObject* tp = Py_TYPE(obj);
25689  if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
25690  return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
25691  }
25692 #endif
25693  result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
25694  if (unlikely(!result)) {
25695  __Pyx_PyObject_GetAttrStr_ClearAttributeError();
25696  }
25697  return result;
25698 }
25699 
25700 /* SetupReduce */
25701 static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25702  int ret;
25703  PyObject *name_attr;
25704  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25705  if (likely(name_attr)) {
25706  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25707  } else {
25708  ret = -1;
25709  }
25710  if (unlikely(ret < 0)) {
25711  PyErr_Clear();
25712  ret = 0;
25713  }
25714  Py_XDECREF(name_attr);
25715  return ret;
25716 }
25717 static int __Pyx_setup_reduce(PyObject* type_obj) {
25718  int ret = 0;
25719  PyObject *object_reduce = NULL;
25720  PyObject *object_reduce_ex = NULL;
25721  PyObject *reduce = NULL;
25722  PyObject *reduce_ex = NULL;
25723  PyObject *reduce_cython = NULL;
25724  PyObject *setstate = NULL;
25725  PyObject *setstate_cython = NULL;
25726 #if CYTHON_USE_PYTYPE_LOOKUP
25727  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25728 #else
25729  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
25730 #endif
25731 #if CYTHON_USE_PYTYPE_LOOKUP
25732  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25733 #else
25734  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
25735 #endif
25736  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
25737  if (reduce_ex == object_reduce_ex) {
25738 #if CYTHON_USE_PYTYPE_LOOKUP
25739  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25740 #else
25741  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
25742 #endif
25743  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
25744  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25745  reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
25746  if (likely(reduce_cython)) {
25747  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25748  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25749  } else if (reduce == object_reduce || PyErr_Occurred()) {
25750  goto __PYX_BAD;
25751  }
25752  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25753  if (!setstate) PyErr_Clear();
25754  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25755  setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
25756  if (likely(setstate_cython)) {
25757  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25758  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
25759  } else if (!setstate || PyErr_Occurred()) {
25760  goto __PYX_BAD;
25761  }
25762  }
25763  PyType_Modified((PyTypeObject*)type_obj);
25764  }
25765  }
25766  goto __PYX_GOOD;
25767 __PYX_BAD:
25768  if (!PyErr_Occurred())
25769  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25770  ret = -1;
25771 __PYX_GOOD:
25772 #if !CYTHON_USE_PYTYPE_LOOKUP
25773  Py_XDECREF(object_reduce);
25774  Py_XDECREF(object_reduce_ex);
25775 #endif
25776  Py_XDECREF(reduce);
25777  Py_XDECREF(reduce_ex);
25778  Py_XDECREF(reduce_cython);
25779  Py_XDECREF(setstate);
25780  Py_XDECREF(setstate_cython);
25781  return ret;
25782 }
25783 
25784 /* FetchCommonType */
25785 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
25786  PyObject* fake_module;
25787  PyTypeObject* cached_type = NULL;
25788  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
25789  if (!fake_module) return NULL;
25790  Py_INCREF(fake_module);
25791  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
25792  if (cached_type) {
25793  if (!PyType_Check((PyObject*)cached_type)) {
25794  PyErr_Format(PyExc_TypeError,
25795  "Shared Cython type %.200s is not a type object",
25796  type->tp_name);
25797  goto bad;
25798  }
25799  if (cached_type->tp_basicsize != type->tp_basicsize) {
25800  PyErr_Format(PyExc_TypeError,
25801  "Shared Cython type %.200s has the wrong size, try recompiling",
25802  type->tp_name);
25803  goto bad;
25804  }
25805  } else {
25806  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
25807  PyErr_Clear();
25808  if (PyType_Ready(type) < 0) goto bad;
25809  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
25810  goto bad;
25811  Py_INCREF(type);
25812  cached_type = type;
25813  }
25814 done:
25815  Py_DECREF(fake_module);
25816  return cached_type;
25817 bad:
25818  Py_XDECREF(cached_type);
25819  cached_type = NULL;
25820  goto done;
25821 }
25822 
25823 /* CythonFunctionShared */
25824 #include <structmember.h>
25825 static PyObject *
25826 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
25827 {
25828  if (unlikely(op->func_doc == NULL)) {
25829  if (op->func.m_ml->ml_doc) {
25830 #if PY_MAJOR_VERSION >= 3
25831  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
25832 #else
25833  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
25834 #endif
25835  if (unlikely(op->func_doc == NULL))
25836  return NULL;
25837  } else {
25838  Py_INCREF(Py_None);
25839  return Py_None;
25840  }
25841  }
25842  Py_INCREF(op->func_doc);
25843  return op->func_doc;
25844 }
25845 static int
25846 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25847 {
25848  PyObject *tmp = op->func_doc;
25849  if (value == NULL) {
25850  value = Py_None;
25851  }
25852  Py_INCREF(value);
25853  op->func_doc = value;
25854  Py_XDECREF(tmp);
25855  return 0;
25856 }
25857 static PyObject *
25858 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25859 {
25860  if (unlikely(op->func_name == NULL)) {
25861 #if PY_MAJOR_VERSION >= 3
25862  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
25863 #else
25864  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
25865 #endif
25866  if (unlikely(op->func_name == NULL))
25867  return NULL;
25868  }
25869  Py_INCREF(op->func_name);
25870  return op->func_name;
25871 }
25872 static int
25873 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25874 {
25875  PyObject *tmp;
25876 #if PY_MAJOR_VERSION >= 3
25877  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25878 #else
25879  if (unlikely(value == NULL || !PyString_Check(value)))
25880 #endif
25881  {
25882  PyErr_SetString(PyExc_TypeError,
25883  "__name__ must be set to a string object");
25884  return -1;
25885  }
25886  tmp = op->func_name;
25887  Py_INCREF(value);
25888  op->func_name = value;
25889  Py_XDECREF(tmp);
25890  return 0;
25891 }
25892 static PyObject *
25893 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25894 {
25895  Py_INCREF(op->func_qualname);
25896  return op->func_qualname;
25897 }
25898 static int
25899 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25900 {
25901  PyObject *tmp;
25902 #if PY_MAJOR_VERSION >= 3
25903  if (unlikely(value == NULL || !PyUnicode_Check(value)))
25904 #else
25905  if (unlikely(value == NULL || !PyString_Check(value)))
25906 #endif
25907  {
25908  PyErr_SetString(PyExc_TypeError,
25909  "__qualname__ must be set to a string object");
25910  return -1;
25911  }
25912  tmp = op->func_qualname;
25913  Py_INCREF(value);
25914  op->func_qualname = value;
25915  Py_XDECREF(tmp);
25916  return 0;
25917 }
25918 static PyObject *
25919 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
25920 {
25921  PyObject *self;
25922  self = m->func_closure;
25923  if (self == NULL)
25924  self = Py_None;
25925  Py_INCREF(self);
25926  return self;
25927 }
25928 static PyObject *
25929 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25930 {
25931  if (unlikely(op->func_dict == NULL)) {
25932  op->func_dict = PyDict_New();
25933  if (unlikely(op->func_dict == NULL))
25934  return NULL;
25935  }
25936  Py_INCREF(op->func_dict);
25937  return op->func_dict;
25938 }
25939 static int
25940 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, CYTHON_UNUSED void *context)
25941 {
25942  PyObject *tmp;
25943  if (unlikely(value == NULL)) {
25944  PyErr_SetString(PyExc_TypeError,
25945  "function's dictionary may not be deleted");
25946  return -1;
25947  }
25948  if (unlikely(!PyDict_Check(value))) {
25949  PyErr_SetString(PyExc_TypeError,
25950  "setting function's dictionary to a non-dict");
25951  return -1;
25952  }
25953  tmp = op->func_dict;
25954  Py_INCREF(value);
25955  op->func_dict = value;
25956  Py_XDECREF(tmp);
25957  return 0;
25958 }
25959 static PyObject *
25960 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25961 {
25962  Py_INCREF(op->func_globals);
25963  return op->func_globals;
25964 }
25965 static PyObject *
25966 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25967 {
25968  Py_INCREF(Py_None);
25969  return Py_None;
25970 }
25971 static PyObject *
25972 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context)
25973 {
25974  PyObject* result = (op->func_code) ? op->func_code : Py_None;
25975  Py_INCREF(result);
25976  return result;
25977 }
25978 static int
25979 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
25980  int result = 0;
25981  PyObject *res = op->defaults_getter((PyObject *) op);
25982  if (unlikely(!res))
25983  return -1;
25984  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
25985  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
25986  Py_INCREF(op->defaults_tuple);
25987  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
25988  Py_INCREF(op->defaults_kwdict);
25989  #else
25990  op->defaults_tuple = PySequence_ITEM(res, 0);
25991  if (unlikely(!op->defaults_tuple)) result = -1;
25992  else {
25993  op->defaults_kwdict = PySequence_ITEM(res, 1);
25994  if (unlikely(!op->defaults_kwdict)) result = -1;
25995  }
25996  #endif
25997  Py_DECREF(res);
25998  return result;
25999 }
26000 static int
26001 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26002  PyObject* tmp;
26003  if (!value) {
26004  value = Py_None;
26005  } else if (value != Py_None && !PyTuple_Check(value)) {
26006  PyErr_SetString(PyExc_TypeError,
26007  "__defaults__ must be set to a tuple object");
26008  return -1;
26009  }
26010  Py_INCREF(value);
26011  tmp = op->defaults_tuple;
26012  op->defaults_tuple = value;
26013  Py_XDECREF(tmp);
26014  return 0;
26015 }
26016 static PyObject *
26017 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26018  PyObject* result = op->defaults_tuple;
26019  if (unlikely(!result)) {
26020  if (op->defaults_getter) {
26021  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26022  result = op->defaults_tuple;
26023  } else {
26024  result = Py_None;
26025  }
26026  }
26027  Py_INCREF(result);
26028  return result;
26029 }
26030 static int
26031 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26032  PyObject* tmp;
26033  if (!value) {
26034  value = Py_None;
26035  } else if (value != Py_None && !PyDict_Check(value)) {
26036  PyErr_SetString(PyExc_TypeError,
26037  "__kwdefaults__ must be set to a dict object");
26038  return -1;
26039  }
26040  Py_INCREF(value);
26041  tmp = op->defaults_kwdict;
26042  op->defaults_kwdict = value;
26043  Py_XDECREF(tmp);
26044  return 0;
26045 }
26046 static PyObject *
26047 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26048  PyObject* result = op->defaults_kwdict;
26049  if (unlikely(!result)) {
26050  if (op->defaults_getter) {
26051  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
26052  result = op->defaults_kwdict;
26053  } else {
26054  result = Py_None;
26055  }
26056  }
26057  Py_INCREF(result);
26058  return result;
26059 }
26060 static int
26061 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, CYTHON_UNUSED void *context) {
26062  PyObject* tmp;
26063  if (!value || value == Py_None) {
26064  value = NULL;
26065  } else if (!PyDict_Check(value)) {
26066  PyErr_SetString(PyExc_TypeError,
26067  "__annotations__ must be set to a dict object");
26068  return -1;
26069  }
26070  Py_XINCREF(value);
26071  tmp = op->func_annotations;
26072  op->func_annotations = value;
26073  Py_XDECREF(tmp);
26074  return 0;
26075 }
26076 static PyObject *
26077 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *context) {
26078  PyObject* result = op->func_annotations;
26079  if (unlikely(!result)) {
26080  result = PyDict_New();
26081  if (unlikely(!result)) return NULL;
26082  op->func_annotations = result;
26083  }
26084  Py_INCREF(result);
26085  return result;
26086 }
26087 static PyGetSetDef __pyx_CyFunction_getsets[] = {
26088  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26089  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
26090  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26091  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
26092  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
26093  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
26094  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26095  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
26096  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26097  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
26098  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26099  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
26100  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26101  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
26102  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26103  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
26104  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
26105  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
26106  {0, 0, 0, 0, 0}
26107 };
26108 static PyMemberDef __pyx_CyFunction_members[] = {
26109  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
26110  {0, 0, 0, 0, 0}
26111 };
26112 static PyObject *
26113 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
26114 {
26115 #if PY_MAJOR_VERSION >= 3
26116  Py_INCREF(m->func_qualname);
26117  return m->func_qualname;
26118 #else
26119  return PyString_FromString(m->func.m_ml->ml_name);
26120 #endif
26121 }
26122 static PyMethodDef __pyx_CyFunction_methods[] = {
26123  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
26124  {0, 0, 0, 0}
26125 };
26126 #if PY_VERSION_HEX < 0x030500A0
26127 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
26128 #else
26129 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
26130 #endif
26131 static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
26132  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26133  if (unlikely(op == NULL))
26134  return NULL;
26135  op->flags = flags;
26136  __Pyx_CyFunction_weakreflist(op) = NULL;
26137  op->func.m_ml = ml;
26138  op->func.m_self = (PyObject *) op;
26139  Py_XINCREF(closure);
26140  op->func_closure = closure;
26141  Py_XINCREF(module);
26142  op->func.m_module = module;
26143  op->func_dict = NULL;
26144  op->func_name = NULL;
26145  Py_INCREF(qualname);
26146  op->func_qualname = qualname;
26147  op->func_doc = NULL;
26148  op->func_classobj = NULL;
26149  op->func_globals = globals;
26150  Py_INCREF(op->func_globals);
26151  Py_XINCREF(code);
26152  op->func_code = code;
26153  op->defaults_pyobjects = 0;
26154  op->defaults_size = 0;
26155  op->defaults = NULL;
26156  op->defaults_tuple = NULL;
26157  op->defaults_kwdict = NULL;
26158  op->defaults_getter = NULL;
26159  op->func_annotations = NULL;
26160  return (PyObject *) op;
26161 }
26162 static int
26163 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
26164 {
26165  Py_CLEAR(m->func_closure);
26166  Py_CLEAR(m->func.m_module);
26167  Py_CLEAR(m->func_dict);
26168  Py_CLEAR(m->func_name);
26169  Py_CLEAR(m->func_qualname);
26170  Py_CLEAR(m->func_doc);
26171  Py_CLEAR(m->func_globals);
26172  Py_CLEAR(m->func_code);
26173  Py_CLEAR(m->func_classobj);
26174  Py_CLEAR(m->defaults_tuple);
26175  Py_CLEAR(m->defaults_kwdict);
26176  Py_CLEAR(m->func_annotations);
26177  if (m->defaults) {
26178  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26179  int i;
26180  for (i = 0; i < m->defaults_pyobjects; i++)
26181  Py_XDECREF(pydefaults[i]);
26182  PyObject_Free(m->defaults);
26183  m->defaults = NULL;
26184  }
26185  return 0;
26186 }
26187 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
26188 {
26189  if (__Pyx_CyFunction_weakreflist(m) != NULL)
26190  PyObject_ClearWeakRefs((PyObject *) m);
26191  __Pyx_CyFunction_clear(m);
26192  PyObject_GC_Del(m);
26193 }
26194 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
26195 {
26196  PyObject_GC_UnTrack(m);
26197  __Pyx__CyFunction_dealloc(m);
26198 }
26199 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
26200 {
26201  Py_VISIT(m->func_closure);
26202  Py_VISIT(m->func.m_module);
26203  Py_VISIT(m->func_dict);
26204  Py_VISIT(m->func_name);
26205  Py_VISIT(m->func_qualname);
26206  Py_VISIT(m->func_doc);
26207  Py_VISIT(m->func_globals);
26208  Py_VISIT(m->func_code);
26209  Py_VISIT(m->func_classobj);
26210  Py_VISIT(m->defaults_tuple);
26211  Py_VISIT(m->defaults_kwdict);
26212  if (m->defaults) {
26213  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
26214  int i;
26215  for (i = 0; i < m->defaults_pyobjects; i++)
26216  Py_VISIT(pydefaults[i]);
26217  }
26218  return 0;
26219 }
26220 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
26221 {
26222 #if PY_MAJOR_VERSION < 3
26223  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26224  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
26225  Py_INCREF(func);
26226  return func;
26227  }
26228  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
26229  if (type == NULL)
26230  type = (PyObject *)(Py_TYPE(obj));
26231  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
26232  }
26233  if (obj == Py_None)
26234  obj = NULL;
26235 #endif
26236  return __Pyx_PyMethod_New(func, obj, type);
26237 }
26238 static PyObject*
26239 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
26240 {
26241 #if PY_MAJOR_VERSION >= 3
26242  return PyUnicode_FromFormat("<cyfunction %U at %p>",
26243  op->func_qualname, (void *)op);
26244 #else
26245  return PyString_FromFormat("<cyfunction %s at %p>",
26246  PyString_AsString(op->func_qualname), (void *)op);
26247 #endif
26248 }
26249 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
26250  PyCFunctionObject* f = (PyCFunctionObject*)func;
26251  PyCFunction meth = f->m_ml->ml_meth;
26252  Py_ssize_t size;
26253  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
26254  case METH_VARARGS:
26255  if (likely(kw == NULL || PyDict_Size(kw) == 0))
26256  return (*meth)(self, arg);
26257  break;
26258  case METH_VARARGS | METH_KEYWORDS:
26259  return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
26260  case METH_NOARGS:
26261  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26262  size = PyTuple_GET_SIZE(arg);
26263  if (likely(size == 0))
26264  return (*meth)(self, NULL);
26265  PyErr_Format(PyExc_TypeError,
26266  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
26267  f->m_ml->ml_name, size);
26268  return NULL;
26269  }
26270  break;
26271  case METH_O:
26272  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
26273  size = PyTuple_GET_SIZE(arg);
26274  if (likely(size == 1)) {
26275  PyObject *result, *arg0;
26276  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
26277  arg0 = PyTuple_GET_ITEM(arg, 0);
26278  #else
26279  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
26280  #endif
26281  result = (*meth)(self, arg0);
26282  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
26283  Py_DECREF(arg0);
26284  #endif
26285  return result;
26286  }
26287  PyErr_Format(PyExc_TypeError,
26288  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
26289  f->m_ml->ml_name, size);
26290  return NULL;
26291  }
26292  break;
26293  default:
26294  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
26295  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
26296  "longer supported!");
26297  return NULL;
26298  }
26299  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
26300  f->m_ml->ml_name);
26301  return NULL;
26302 }
26303 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
26304  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
26305 }
26306 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
26307  PyObject *result;
26308  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
26309  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
26310  Py_ssize_t argc;
26311  PyObject *new_args;
26312  PyObject *self;
26313  argc = PyTuple_GET_SIZE(args);
26314  new_args = PyTuple_GetSlice(args, 1, argc);
26315  if (unlikely(!new_args))
26316  return NULL;
26317  self = PyTuple_GetItem(args, 0);
26318  if (unlikely(!self)) {
26319  Py_DECREF(new_args);
26320  return NULL;
26321  }
26322  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
26323  Py_DECREF(new_args);
26324  } else {
26325  result = __Pyx_CyFunction_Call(func, args, kw);
26326  }
26327  return result;
26328 }
26329 static PyTypeObject __pyx_CyFunctionType_type = {
26330  PyVarObject_HEAD_INIT(0, 0)
26331  "cython_function_or_method",
26332  sizeof(__pyx_CyFunctionObject),
26333  0,
26334  (destructor) __Pyx_CyFunction_dealloc,
26335  0,
26336  0,
26337  0,
26338 #if PY_MAJOR_VERSION < 3
26339  0,
26340 #else
26341  0,
26342 #endif
26343  (reprfunc) __Pyx_CyFunction_repr,
26344  0,
26345  0,
26346  0,
26347  0,
26348  __Pyx_CyFunction_CallAsMethod,
26349  0,
26350  0,
26351  0,
26352  0,
26353  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
26354  0,
26355  (traverseproc) __Pyx_CyFunction_traverse,
26356  (inquiry) __Pyx_CyFunction_clear,
26357  0,
26358 #if PY_VERSION_HEX < 0x030500A0
26359  offsetof(__pyx_CyFunctionObject, func_weakreflist),
26360 #else
26361  offsetof(PyCFunctionObject, m_weakreflist),
26362 #endif
26363  0,
26364  0,
26365  __pyx_CyFunction_methods,
26366  __pyx_CyFunction_members,
26367  __pyx_CyFunction_getsets,
26368  0,
26369  0,
26370  __Pyx_CyFunction_descr_get,
26371  0,
26372  offsetof(__pyx_CyFunctionObject, func_dict),
26373  0,
26374  0,
26375  0,
26376  0,
26377  0,
26378  0,
26379  0,
26380  0,
26381  0,
26382  0,
26383  0,
26384  0,
26385 #if PY_VERSION_HEX >= 0x030400a1
26386  0,
26387 #endif
26388 #if PY_VERSION_HEX >= 0x030800b1
26389  0,
26390 #endif
26391 #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
26392  0,
26393 #endif
26394 };
26395 static int __pyx_CyFunction_init(void) {
26396  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
26397  if (unlikely(__pyx_CyFunctionType == NULL)) {
26398  return -1;
26399  }
26400  return 0;
26401 }
26402 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
26403  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26404  m->defaults = PyObject_Malloc(size);
26405  if (unlikely(!m->defaults))
26406  return PyErr_NoMemory();
26407  memset(m->defaults, 0, size);
26408  m->defaults_pyobjects = pyobjects;
26409  m->defaults_size = size;
26410  return m->defaults;
26411 }
26412 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
26413  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26414  m->defaults_tuple = tuple;
26415  Py_INCREF(tuple);
26416 }
26417 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
26418  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26419  m->defaults_kwdict = dict;
26420  Py_INCREF(dict);
26421 }
26422 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
26423  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
26424  m->func_annotations = dict;
26425  Py_INCREF(dict);
26426 }
26427 
26428 /* CythonFunction */
26429 static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
26430  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
26431  PyObject *op = __Pyx_CyFunction_Init(
26432  PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
26433  ml, flags, qualname, closure, module, globals, code
26434  );
26435  if (likely(op)) {
26436  PyObject_GC_Track(op);
26437  }
26438  return op;
26439 }
26440 
26441 /* CLineInTraceback */
26442 #ifndef CYTHON_CLINE_IN_TRACEBACK
26443 static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
26444  PyObject *use_cline;
26445  PyObject *ptype, *pvalue, *ptraceback;
26446 #if CYTHON_COMPILING_IN_CPYTHON
26447  PyObject **cython_runtime_dict;
26448 #endif
26449  if (unlikely(!__pyx_cython_runtime)) {
26450  return c_line;
26451  }
26452  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
26453 #if CYTHON_COMPILING_IN_CPYTHON
26454  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
26455  if (likely(cython_runtime_dict)) {
26456  __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
26457  use_cline, *cython_runtime_dict,
26458  __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
26459  } else
26460 #endif
26461  {
26462  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
26463  if (use_cline_obj) {
26464  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
26465  Py_DECREF(use_cline_obj);
26466  } else {
26467  PyErr_Clear();
26468  use_cline = NULL;
26469  }
26470  }
26471  if (!use_cline) {
26472  c_line = 0;
26473  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
26474  }
26475  else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
26476  c_line = 0;
26477  }
26478  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
26479  return c_line;
26480 }
26481 #endif
26482 
26483 /* CodeObjectCache */
26484 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
26485  int start = 0, mid = 0, end = count - 1;
26486  if (end >= 0 && code_line > entries[end].code_line) {
26487  return count;
26488  }
26489  while (start < end) {
26490  mid = start + (end - start) / 2;
26491  if (code_line < entries[mid].code_line) {
26492  end = mid;
26493  } else if (code_line > entries[mid].code_line) {
26494  start = mid + 1;
26495  } else {
26496  return mid;
26497  }
26498  }
26499  if (code_line <= entries[mid].code_line) {
26500  return mid;
26501  } else {
26502  return mid + 1;
26503  }
26504 }
26505 static PyCodeObject *__pyx_find_code_object(int code_line) {
26506  PyCodeObject* code_object;
26507  int pos;
26508  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
26509  return NULL;
26510  }
26511  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26512  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
26513  return NULL;
26514  }
26515  code_object = __pyx_code_cache.entries[pos].code_object;
26516  Py_INCREF(code_object);
26517  return code_object;
26518 }
26519 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
26520  int pos, i;
26521  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
26522  if (unlikely(!code_line)) {
26523  return;
26524  }
26525  if (unlikely(!entries)) {
26526  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26527  if (likely(entries)) {
26528  __pyx_code_cache.entries = entries;
26529  __pyx_code_cache.max_count = 64;
26530  __pyx_code_cache.count = 1;
26531  entries[0].code_line = code_line;
26532  entries[0].code_object = code_object;
26533  Py_INCREF(code_object);
26534  }
26535  return;
26536  }
26537  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26538  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26539  PyCodeObject* tmp = entries[pos].code_object;
26540  entries[pos].code_object = code_object;
26541  Py_DECREF(tmp);
26542  return;
26543  }
26544  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26545  int new_max = __pyx_code_cache.max_count + 64;
26546  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26547  __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
26548  if (unlikely(!entries)) {
26549  return;
26550  }
26551  __pyx_code_cache.entries = entries;
26552  __pyx_code_cache.max_count = new_max;
26553  }
26554  for (i=__pyx_code_cache.count; i>pos; i--) {
26555  entries[i] = entries[i-1];
26556  }
26557  entries[pos].code_line = code_line;
26558  entries[pos].code_object = code_object;
26559  __pyx_code_cache.count++;
26560  Py_INCREF(code_object);
26561 }
26562 
26563 /* AddTraceback */
26564 #include "compile.h"
26565 #include "frameobject.h"
26566 #include "traceback.h"
26567 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26568  const char *funcname, int c_line,
26569  int py_line, const char *filename) {
26570  PyCodeObject *py_code = 0;
26571  PyObject *py_srcfile = 0;
26572  PyObject *py_funcname = 0;
26573  #if PY_MAJOR_VERSION < 3
26574  py_srcfile = PyString_FromString(filename);
26575  #else
26576  py_srcfile = PyUnicode_FromString(filename);
26577  #endif
26578  if (!py_srcfile) goto bad;
26579  if (c_line) {
26580  #if PY_MAJOR_VERSION < 3
26581  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26582  #else
26583  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26584  #endif
26585  }
26586  else {
26587  #if PY_MAJOR_VERSION < 3
26588  py_funcname = PyString_FromString(funcname);
26589  #else
26590  py_funcname = PyUnicode_FromString(funcname);
26591  #endif
26592  }
26593  if (!py_funcname) goto bad;
26594  py_code = __Pyx_PyCode_New(
26595  0,
26596  0,
26597  0,
26598  0,
26599  0,
26600  __pyx_empty_bytes, /*PyObject *code,*/
26601  __pyx_empty_tuple, /*PyObject *consts,*/
26602  __pyx_empty_tuple, /*PyObject *names,*/
26603  __pyx_empty_tuple, /*PyObject *varnames,*/
26604  __pyx_empty_tuple, /*PyObject *freevars,*/
26605  __pyx_empty_tuple, /*PyObject *cellvars,*/
26606  py_srcfile, /*PyObject *filename,*/
26607  py_funcname, /*PyObject *name,*/
26608  py_line,
26609  __pyx_empty_bytes /*PyObject *lnotab*/
26610  );
26611  Py_DECREF(py_srcfile);
26612  Py_DECREF(py_funcname);
26613  return py_code;
26614 bad:
26615  Py_XDECREF(py_srcfile);
26616  Py_XDECREF(py_funcname);
26617  return NULL;
26618 }
26619 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26620  int py_line, const char *filename) {
26621  PyCodeObject *py_code = 0;
26622  PyFrameObject *py_frame = 0;
26623  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26624  if (c_line) {
26625  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26626  }
26627  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26628  if (!py_code) {
26629  py_code = __Pyx_CreateCodeObjectForTraceback(
26630  funcname, c_line, py_line, filename);
26631  if (!py_code) goto bad;
26632  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26633  }
26634  py_frame = PyFrame_New(
26635  tstate, /*PyThreadState *tstate,*/
26636  py_code, /*PyCodeObject *code,*/
26637  __pyx_d, /*PyObject *globals,*/
26638  0 /*PyObject *locals*/
26639  );
26640  if (!py_frame) goto bad;
26641  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26642  PyTraceBack_Here(py_frame);
26643 bad:
26644  Py_XDECREF(py_code);
26645  Py_XDECREF(py_frame);
26646 }
26647 
26648 #if PY_MAJOR_VERSION < 3
26649 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26650  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26651  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26652  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26653  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26654  return -1;
26655 }
26656 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26657  PyObject *obj = view->obj;
26658  if (!obj) return;
26659  if (PyObject_CheckBuffer(obj)) {
26660  PyBuffer_Release(view);
26661  return;
26662  }
26663  if ((0)) {}
26664  view->obj = NULL;
26665  Py_DECREF(obj);
26666 }
26667 #endif
26668 
26669 
26670 /* MemviewSliceIsContig */
26671 static int
26672 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26673 {
26674  int i, index, step, start;
26675  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26676  if (order == 'F') {
26677  step = 1;
26678  start = 0;
26679  } else {
26680  step = -1;
26681  start = ndim - 1;
26682  }
26683  for (i = 0; i < ndim; i++) {
26684  index = start + step * i;
26685  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26686  return 0;
26687  itemsize *= mvs.shape[index];
26688  }
26689  return 1;
26690 }
26691 
26692 /* OverlappingSlices */
26693 static void
26694 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26695  void **out_start, void **out_end,
26696  int ndim, size_t itemsize)
26697 {
26698  char *start, *end;
26699  int i;
26700  start = end = slice->data;
26701  for (i = 0; i < ndim; i++) {
26702  Py_ssize_t stride = slice->strides[i];
26703  Py_ssize_t extent = slice->shape[i];
26704  if (extent == 0) {
26705  *out_start = *out_end = start;
26706  return;
26707  } else {
26708  if (stride > 0)
26709  end += stride * (extent - 1);
26710  else
26711  start += stride * (extent - 1);
26712  }
26713  }
26714  *out_start = start;
26715  *out_end = end + itemsize;
26716 }
26717 static int
26718 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26719  __Pyx_memviewslice *slice2,
26720  int ndim, size_t itemsize)
26721 {
26722  void *start1, *end1, *start2, *end2;
26723  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26724  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26725  return (start1 < end2) && (start2 < end1);
26726 }
26727 
26728 /* Capsule */
26729 static CYTHON_INLINE PyObject *
26730 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26731 {
26732  PyObject *cobj;
26733 #if PY_VERSION_HEX >= 0x02070000
26734  cobj = PyCapsule_New(p, sig, NULL);
26735 #else
26736  cobj = PyCObject_FromVoidPtr(p, NULL);
26737 #endif
26738  return cobj;
26739 }
26740 
26741 /* CIntFromPyVerify */
26742 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
26743  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
26744 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
26745  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
26746 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
26747  {\
26748  func_type value = func_value;\
26749  if (sizeof(target_type) < sizeof(func_type)) {\
26750  if (unlikely(value != (func_type) (target_type) value)) {\
26751  func_type zero = 0;\
26752  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
26753  return (target_type) -1;\
26754  if (is_unsigned && unlikely(value < zero))\
26755  goto raise_neg_overflow;\
26756  else\
26757  goto raise_overflow;\
26758  }\
26759  }\
26760  return (target_type) value;\
26761  }
26762 
26763 /* IsLittleEndian */
26764 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26765 {
26766  union {
26767  uint32_t u32;
26768  uint8_t u8[4];
26769  } S;
26770  S.u32 = 0x01020304;
26771  return S.u8[0] == 4;
26772 }
26773 
26774 /* BufferFormatCheck */
26775 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26776  __Pyx_BufFmt_StackElem* stack,
26777  __Pyx_TypeInfo* type) {
26778  stack[0].field = &ctx->root;
26779  stack[0].parent_offset = 0;
26780  ctx->root.type = type;
26781  ctx->root.name = "buffer dtype";
26782  ctx->root.offset = 0;
26783  ctx->head = stack;
26784  ctx->head->field = &ctx->root;
26785  ctx->fmt_offset = 0;
26786  ctx->head->parent_offset = 0;
26787  ctx->new_packmode = '@';
26788  ctx->enc_packmode = '@';
26789  ctx->new_count = 1;
26790  ctx->enc_count = 0;
26791  ctx->enc_type = 0;
26792  ctx->is_complex = 0;
26793  ctx->is_valid_array = 0;
26794  ctx->struct_alignment = 0;
26795  while (type->typegroup == 'S') {
26796  ++ctx->head;
26797  ctx->head->field = type->fields;
26798  ctx->head->parent_offset = 0;
26799  type = type->fields->type;
26800  }
26801 }
26802 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26803  int count;
26804  const char* t = *ts;
26805  if (*t < '0' || *t > '9') {
26806  return -1;
26807  } else {
26808  count = *t++ - '0';
26809  while (*t >= '0' && *t <= '9') {
26810  count *= 10;
26811  count += *t++ - '0';
26812  }
26813  }
26814  *ts = t;
26815  return count;
26816 }
26817 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26818  int number = __Pyx_BufFmt_ParseNumber(ts);
26819  if (number == -1)
26820  PyErr_Format(PyExc_ValueError,\
26821  "Does not understand character buffer dtype format string ('%c')", **ts);
26822  return number;
26823 }
26824 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26825  PyErr_Format(PyExc_ValueError,
26826  "Unexpected format string character: '%c'", ch);
26827 }
26828 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26829  switch (ch) {
26830  case '?': return "'bool'";
26831  case 'c': return "'char'";
26832  case 'b': return "'signed char'";
26833  case 'B': return "'unsigned char'";
26834  case 'h': return "'short'";
26835  case 'H': return "'unsigned short'";
26836  case 'i': return "'int'";
26837  case 'I': return "'unsigned int'";
26838  case 'l': return "'long'";
26839  case 'L': return "'unsigned long'";
26840  case 'q': return "'long long'";
26841  case 'Q': return "'unsigned long long'";
26842  case 'f': return (is_complex ? "'complex float'" : "'float'");
26843  case 'd': return (is_complex ? "'complex double'" : "'double'");
26844  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26845  case 'T': return "a struct";
26846  case 'O': return "Python object";
26847  case 'P': return "a pointer";
26848  case 's': case 'p': return "a string";
26849  case 0: return "end";
26850  default: return "unparseable format string";
26851  }
26852 }
26853 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26854  switch (ch) {
26855  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26856  case 'h': case 'H': return 2;
26857  case 'i': case 'I': case 'l': case 'L': return 4;
26858  case 'q': case 'Q': return 8;
26859  case 'f': return (is_complex ? 8 : 4);
26860  case 'd': return (is_complex ? 16 : 8);
26861  case 'g': {
26862  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26863  return 0;
26864  }
26865  case 'O': case 'P': return sizeof(void*);
26866  default:
26867  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26868  return 0;
26869  }
26870 }
26871 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26872  switch (ch) {
26873  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26874  case 'h': case 'H': return sizeof(short);
26875  case 'i': case 'I': return sizeof(int);
26876  case 'l': case 'L': return sizeof(long);
26877  #ifdef HAVE_LONG_LONG
26878  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26879  #endif
26880  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26881  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26882  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26883  case 'O': case 'P': return sizeof(void*);
26884  default: {
26885  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26886  return 0;
26887  }
26888  }
26889 }
26890 typedef struct { char c; short x; } __Pyx_st_short;
26891 typedef struct { char c; int x; } __Pyx_st_int;
26892 typedef struct { char c; long x; } __Pyx_st_long;
26893 typedef struct { char c; float x; } __Pyx_st_float;
26894 typedef struct { char c; double x; } __Pyx_st_double;
26895 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26896 typedef struct { char c; void *x; } __Pyx_st_void_p;
26897 #ifdef HAVE_LONG_LONG
26898 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26899 #endif
26900 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26901  switch (ch) {
26902  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26903  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26904  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26905  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26906 #ifdef HAVE_LONG_LONG
26907  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26908 #endif
26909  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26910  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26911  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26912  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26913  default:
26914  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26915  return 0;
26916  }
26917 }
26918 /* These are for computing the padding at the end of the struct to align
26919  on the first member of the struct. This will probably the same as above,
26920  but we don't have any guarantees.
26921  */
26922 typedef struct { short x; char c; } __Pyx_pad_short;
26923 typedef struct { int x; char c; } __Pyx_pad_int;
26924 typedef struct { long x; char c; } __Pyx_pad_long;
26925 typedef struct { float x; char c; } __Pyx_pad_float;
26926 typedef struct { double x; char c; } __Pyx_pad_double;
26927 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26928 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26929 #ifdef HAVE_LONG_LONG
26930 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26931 #endif
26932 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26933  switch (ch) {
26934  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26935  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26936  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26937  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26938 #ifdef HAVE_LONG_LONG
26939  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26940 #endif
26941  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26942  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26943  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26944  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26945  default:
26946  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26947  return 0;
26948  }
26949 }
26950 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26951  switch (ch) {
26952  case 'c':
26953  return 'H';
26954  case 'b': case 'h': case 'i':
26955  case 'l': case 'q': case 's': case 'p':
26956  return 'I';
26957  case '?': case 'B': case 'H': case 'I': case 'L': case 'Q':
26958  return 'U';
26959  case 'f': case 'd': case 'g':
26960  return (is_complex ? 'C' : 'R');
26961  case 'O':
26962  return 'O';
26963  case 'P':
26964  return 'P';
26965  default: {
26966  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26967  return 0;
26968  }
26969  }
26970 }
26971 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26972  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26973  const char* expected;
26974  const char* quote;
26975  if (ctx->head == NULL) {
26976  expected = "end";
26977  quote = "";
26978  } else {
26979  expected = ctx->head->field->type->name;
26980  quote = "'";
26981  }
26982  PyErr_Format(PyExc_ValueError,
26983  "Buffer dtype mismatch, expected %s%s%s but got %s",
26984  quote, expected, quote,
26985  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26986  } else {
26987  __Pyx_StructField* field = ctx->head->field;
26988  __Pyx_StructField* parent = (ctx->head - 1)->field;
26989  PyErr_Format(PyExc_ValueError,
26990  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26991  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26992  parent->type->name, field->name);
26993  }
26994 }
26995 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26996  char group;
26997  size_t size, offset, arraysize = 1;
26998  if (ctx->enc_type == 0) return 0;
26999  if (ctx->head->field->type->arraysize[0]) {
27000  int i, ndim = 0;
27001  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
27002  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
27003  ndim = 1;
27004  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
27005  PyErr_Format(PyExc_ValueError,
27006  "Expected a dimension of size %zu, got %zu",
27007  ctx->head->field->type->arraysize[0], ctx->enc_count);
27008  return -1;
27009  }
27010  }
27011  if (!ctx->is_valid_array) {
27012  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
27013  ctx->head->field->type->ndim, ndim);
27014  return -1;
27015  }
27016  for (i = 0; i < ctx->head->field->type->ndim; i++) {
27017  arraysize *= ctx->head->field->type->arraysize[i];
27018  }
27019  ctx->is_valid_array = 0;
27020  ctx->enc_count = 1;
27021  }
27022  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
27023  do {
27024  __Pyx_StructField* field = ctx->head->field;
27025  __Pyx_TypeInfo* type = field->type;
27026  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
27027  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
27028  } else {
27029  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
27030  }
27031  if (ctx->enc_packmode == '@') {
27032  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
27033  size_t align_mod_offset;
27034  if (align_at == 0) return -1;
27035  align_mod_offset = ctx->fmt_offset % align_at;
27036  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
27037  if (ctx->struct_alignment == 0)
27038  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
27039  ctx->is_complex);
27040  }
27041  if (type->size != size || type->typegroup != group) {
27042  if (type->typegroup == 'C' && type->fields != NULL) {
27043  size_t parent_offset = ctx->head->parent_offset + field->offset;
27044  ++ctx->head;
27045  ctx->head->field = type->fields;
27046  ctx->head->parent_offset = parent_offset;
27047  continue;
27048  }
27049  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
27050  } else {
27051  __Pyx_BufFmt_RaiseExpected(ctx);
27052  return -1;
27053  }
27054  }
27055  offset = ctx->head->parent_offset + field->offset;
27056  if (ctx->fmt_offset != offset) {
27057  PyErr_Format(PyExc_ValueError,
27058  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
27059  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
27060  return -1;
27061  }
27062  ctx->fmt_offset += size;
27063  if (arraysize)
27064  ctx->fmt_offset += (arraysize - 1) * size;
27065  --ctx->enc_count;
27066  while (1) {
27067  if (field == &ctx->root) {
27068  ctx->head = NULL;
27069  if (ctx->enc_count != 0) {
27070  __Pyx_BufFmt_RaiseExpected(ctx);
27071  return -1;
27072  }
27073  break;
27074  }
27075  ctx->head->field = ++field;
27076  if (field->type == NULL) {
27077  --ctx->head;
27078  field = ctx->head->field;
27079  continue;
27080  } else if (field->type->typegroup == 'S') {
27081  size_t parent_offset = ctx->head->parent_offset + field->offset;
27082  if (field->type->fields->type == NULL) continue;
27083  field = field->type->fields;
27084  ++ctx->head;
27085  ctx->head->field = field;
27086  ctx->head->parent_offset = parent_offset;
27087  break;
27088  } else {
27089  break;
27090  }
27091  }
27092  } while (ctx->enc_count);
27093  ctx->enc_type = 0;
27094  ctx->is_complex = 0;
27095  return 0;
27096 }
27097 static PyObject *
27098 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
27099 {
27100  const char *ts = *tsp;
27101  int i = 0, number, ndim;
27102  ++ts;
27103  if (ctx->new_count != 1) {
27104  PyErr_SetString(PyExc_ValueError,
27105  "Cannot handle repeated arrays in format string");
27106  return NULL;
27107  }
27108  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27109  ndim = ctx->head->field->type->ndim;
27110  while (*ts && *ts != ')') {
27111  switch (*ts) {
27112  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
27113  default: break;
27114  }
27115  number = __Pyx_BufFmt_ExpectNumber(&ts);
27116  if (number == -1) return NULL;
27117  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
27118  return PyErr_Format(PyExc_ValueError,
27119  "Expected a dimension of size %zu, got %d",
27120  ctx->head->field->type->arraysize[i], number);
27121  if (*ts != ',' && *ts != ')')
27122  return PyErr_Format(PyExc_ValueError,
27123  "Expected a comma in format string, got '%c'", *ts);
27124  if (*ts == ',') ts++;
27125  i++;
27126  }
27127  if (i != ndim)
27128  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
27129  ctx->head->field->type->ndim, i);
27130  if (!*ts) {
27131  PyErr_SetString(PyExc_ValueError,
27132  "Unexpected end of format string, expected ')'");
27133  return NULL;
27134  }
27135  ctx->is_valid_array = 1;
27136  ctx->new_count = 1;
27137  *tsp = ++ts;
27138  return Py_None;
27139 }
27140 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
27141  int got_Z = 0;
27142  while (1) {
27143  switch(*ts) {
27144  case 0:
27145  if (ctx->enc_type != 0 && ctx->head == NULL) {
27146  __Pyx_BufFmt_RaiseExpected(ctx);
27147  return NULL;
27148  }
27149  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27150  if (ctx->head != NULL) {
27151  __Pyx_BufFmt_RaiseExpected(ctx);
27152  return NULL;
27153  }
27154  return ts;
27155  case ' ':
27156  case '\r':
27157  case '\n':
27158  ++ts;
27159  break;
27160  case '<':
27161  if (!__Pyx_Is_Little_Endian()) {
27162  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
27163  return NULL;
27164  }
27165  ctx->new_packmode = '=';
27166  ++ts;
27167  break;
27168  case '>':
27169  case '!':
27170  if (__Pyx_Is_Little_Endian()) {
27171  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
27172  return NULL;
27173  }
27174  ctx->new_packmode = '=';
27175  ++ts;
27176  break;
27177  case '=':
27178  case '@':
27179  case '^':
27180  ctx->new_packmode = *ts++;
27181  break;
27182  case 'T':
27183  {
27184  const char* ts_after_sub;
27185  size_t i, struct_count = ctx->new_count;
27186  size_t struct_alignment = ctx->struct_alignment;
27187  ctx->new_count = 1;
27188  ++ts;
27189  if (*ts != '{') {
27190  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
27191  return NULL;
27192  }
27193  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27194  ctx->enc_type = 0;
27195  ctx->enc_count = 0;
27196  ctx->struct_alignment = 0;
27197  ++ts;
27198  ts_after_sub = ts;
27199  for (i = 0; i != struct_count; ++i) {
27200  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
27201  if (!ts_after_sub) return NULL;
27202  }
27203  ts = ts_after_sub;
27204  if (struct_alignment) ctx->struct_alignment = struct_alignment;
27205  }
27206  break;
27207  case '}':
27208  {
27209  size_t alignment = ctx->struct_alignment;
27210  ++ts;
27211  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27212  ctx->enc_type = 0;
27213  if (alignment && ctx->fmt_offset % alignment) {
27214  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
27215  }
27216  }
27217  return ts;
27218  case 'x':
27219  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27220  ctx->fmt_offset += ctx->new_count;
27221  ctx->new_count = 1;
27222  ctx->enc_count = 0;
27223  ctx->enc_type = 0;
27224  ctx->enc_packmode = ctx->new_packmode;
27225  ++ts;
27226  break;
27227  case 'Z':
27228  got_Z = 1;
27229  ++ts;
27230  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
27231  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
27232  return NULL;
27233  }
27234  CYTHON_FALLTHROUGH;
27235  case '?': case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
27236  case 'l': case 'L': case 'q': case 'Q':
27237  case 'f': case 'd': case 'g':
27238  case 'O': case 'p':
27239  if ((ctx->enc_type == *ts) && (got_Z == ctx->is_complex) &&
27240  (ctx->enc_packmode == ctx->new_packmode) && (!ctx->is_valid_array)) {
27241  ctx->enc_count += ctx->new_count;
27242  ctx->new_count = 1;
27243  got_Z = 0;
27244  ++ts;
27245  break;
27246  }
27247  CYTHON_FALLTHROUGH;
27248  case 's':
27249  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
27250  ctx->enc_count = ctx->new_count;
27251  ctx->enc_packmode = ctx->new_packmode;
27252  ctx->enc_type = *ts;
27253  ctx->is_complex = got_Z;
27254  ++ts;
27255  ctx->new_count = 1;
27256  got_Z = 0;
27257  break;
27258  case ':':
27259  ++ts;
27260  while(*ts != ':') ++ts;
27261  ++ts;
27262  break;
27263  case '(':
27264  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
27265  break;
27266  default:
27267  {
27268  int number = __Pyx_BufFmt_ExpectNumber(&ts);
27269  if (number == -1) return NULL;
27270  ctx->new_count = (size_t)number;
27271  }
27272  }
27273  }
27274 }
27275 
27276 /* TypeInfoCompare */
27277  static int
27278 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
27279 {
27280  int i;
27281  if (!a || !b)
27282  return 0;
27283  if (a == b)
27284  return 1;
27285  if (a->size != b->size || a->typegroup != b->typegroup ||
27286  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
27287  if (a->typegroup == 'H' || b->typegroup == 'H') {
27288  return a->size == b->size;
27289  } else {
27290  return 0;
27291  }
27292  }
27293  if (a->ndim) {
27294  for (i = 0; i < a->ndim; i++)
27295  if (a->arraysize[i] != b->arraysize[i])
27296  return 0;
27297  }
27298  if (a->typegroup == 'S') {
27299  if (a->flags != b->flags)
27300  return 0;
27301  if (a->fields || b->fields) {
27302  if (!(a->fields && b->fields))
27303  return 0;
27304  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
27305  __Pyx_StructField *field_a = a->fields + i;
27306  __Pyx_StructField *field_b = b->fields + i;
27307  if (field_a->offset != field_b->offset ||
27308  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
27309  return 0;
27310  }
27311  return !a->fields[i].type && !b->fields[i].type;
27312  }
27313  }
27314  return 1;
27315 }
27316 
27317 /* MemviewSliceValidateAndInit */
27318  static int
27319 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
27320 {
27321  if (buf->shape[dim] <= 1)
27322  return 1;
27323  if (buf->strides) {
27324  if (spec & __Pyx_MEMVIEW_CONTIG) {
27325  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
27326  if (unlikely(buf->strides[dim] != sizeof(void *))) {
27327  PyErr_Format(PyExc_ValueError,
27328  "Buffer is not indirectly contiguous "
27329  "in dimension %d.", dim);
27330  goto fail;
27331  }
27332  } else if (unlikely(buf->strides[dim] != buf->itemsize)) {
27333  PyErr_SetString(PyExc_ValueError,
27334  "Buffer and memoryview are not contiguous "
27335  "in the same dimension.");
27336  goto fail;
27337  }
27338  }
27339  if (spec & __Pyx_MEMVIEW_FOLLOW) {
27340  Py_ssize_t stride = buf->strides[dim];
27341  if (stride < 0)
27342  stride = -stride;
27343  if (unlikely(stride < buf->itemsize)) {
27344  PyErr_SetString(PyExc_ValueError,
27345  "Buffer and memoryview are not contiguous "
27346  "in the same dimension.");
27347  goto fail;
27348  }
27349  }
27350  } else {
27351  if (unlikely(spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1)) {
27352  PyErr_Format(PyExc_ValueError,
27353  "C-contiguous buffer is not contiguous in "
27354  "dimension %d", dim);
27355  goto fail;
27356  } else if (unlikely(spec & (__Pyx_MEMVIEW_PTR))) {
27357  PyErr_Format(PyExc_ValueError,
27358  "C-contiguous buffer is not indirect in "
27359  "dimension %d", dim);
27360  goto fail;
27361  } else if (unlikely(buf->suboffsets)) {
27362  PyErr_SetString(PyExc_ValueError,
27363  "Buffer exposes suboffsets but no strides");
27364  goto fail;
27365  }
27366  }
27367  return 1;
27368 fail:
27369  return 0;
27370 }
27371 static int
27372 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
27373 {
27374  if (spec & __Pyx_MEMVIEW_DIRECT) {
27375  if (unlikely(buf->suboffsets && buf->suboffsets[dim] >= 0)) {
27376  PyErr_Format(PyExc_ValueError,
27377  "Buffer not compatible with direct access "
27378  "in dimension %d.", dim);
27379  goto fail;
27380  }
27381  }
27382  if (spec & __Pyx_MEMVIEW_PTR) {
27383  if (unlikely(!buf->suboffsets || (buf->suboffsets[dim] < 0))) {
27384  PyErr_Format(PyExc_ValueError,
27385  "Buffer is not indirectly accessible "
27386  "in dimension %d.", dim);
27387  goto fail;
27388  }
27389  }
27390  return 1;
27391 fail:
27392  return 0;
27393 }
27394 static int
27395 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
27396 {
27397  int i;
27398  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
27399  Py_ssize_t stride = 1;
27400  for (i = 0; i < ndim; i++) {
27401  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27402  PyErr_SetString(PyExc_ValueError,
27403  "Buffer not fortran contiguous.");
27404  goto fail;
27405  }
27406  stride = stride * buf->shape[i];
27407  }
27408  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
27409  Py_ssize_t stride = 1;
27410  for (i = ndim - 1; i >- 1; i--) {
27411  if (unlikely(stride * buf->itemsize != buf->strides[i] && buf->shape[i] > 1)) {
27412  PyErr_SetString(PyExc_ValueError,
27413  "Buffer not C contiguous.");
27414  goto fail;
27415  }
27416  stride = stride * buf->shape[i];
27417  }
27418  }
27419  return 1;
27420 fail:
27421  return 0;
27422 }
27423 static int __Pyx_ValidateAndInit_memviewslice(
27424  int *axes_specs,
27425  int c_or_f_flag,
27426  int buf_flags,
27427  int ndim,
27428  __Pyx_TypeInfo *dtype,
27429  __Pyx_BufFmt_StackElem stack[],
27430  __Pyx_memviewslice *memviewslice,
27431  PyObject *original_obj)
27432 {
27433  struct __pyx_memoryview_obj *memview, *new_memview;
27434  __Pyx_RefNannyDeclarations
27435  Py_buffer *buf;
27436  int i, spec = 0, retval = -1;
27437  __Pyx_BufFmt_Context ctx;
27438  int from_memoryview = __pyx_memoryview_check(original_obj);
27439  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
27440  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
27441  original_obj)->typeinfo)) {
27442  memview = (struct __pyx_memoryview_obj *) original_obj;
27443  new_memview = NULL;
27444  } else {
27445  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27446  original_obj, buf_flags, 0, dtype);
27447  new_memview = memview;
27448  if (unlikely(!memview))
27449  goto fail;
27450  }
27451  buf = &memview->view;
27452  if (unlikely(buf->ndim != ndim)) {
27453  PyErr_Format(PyExc_ValueError,
27454  "Buffer has wrong number of dimensions (expected %d, got %d)",
27455  ndim, buf->ndim);
27456  goto fail;
27457  }
27458  if (new_memview) {
27459  __Pyx_BufFmt_Init(&ctx, stack, dtype);
27460  if (unlikely(!__Pyx_BufFmt_CheckString(&ctx, buf->format))) goto fail;
27461  }
27462  if (unlikely((unsigned) buf->itemsize != dtype->size)) {
27463  PyErr_Format(PyExc_ValueError,
27464  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
27465  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
27466  buf->itemsize,
27467  (buf->itemsize > 1) ? "s" : "",
27468  dtype->name,
27469  dtype->size,
27470  (dtype->size > 1) ? "s" : "");
27471  goto fail;
27472  }
27473  if (buf->len > 0) {
27474  for (i = 0; i < ndim; i++) {
27475  spec = axes_specs[i];
27476  if (unlikely(!__pyx_check_strides(buf, i, ndim, spec)))
27477  goto fail;
27478  if (unlikely(!__pyx_check_suboffsets(buf, i, ndim, spec)))
27479  goto fail;
27480  }
27481  if (unlikely(buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag)))
27482  goto fail;
27483  }
27484  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
27485  new_memview != NULL) == -1)) {
27486  goto fail;
27487  }
27488  retval = 0;
27489  goto no_fail;
27490 fail:
27491  Py_XDECREF(new_memview);
27492  retval = -1;
27493 no_fail:
27494  __Pyx_RefNannyFinishContext();
27495  return retval;
27496 }
27497 
27498 /* ObjectToMemviewSlice */
27499  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_float(PyObject *obj, int writable_flag) {
27500  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27501  __Pyx_BufFmt_StackElem stack[1];
27502  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27503  int retcode;
27504  if (obj == Py_None) {
27505  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27506  return result;
27507  }
27508  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27509  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27510  &__Pyx_TypeInfo_float, stack,
27511  &result, obj);
27512  if (unlikely(retcode == -1))
27513  goto __pyx_fail;
27514  return result;
27515 __pyx_fail:
27516  result.memview = NULL;
27517  result.data = NULL;
27518  return result;
27519 }
27520 
27521 /* ObjectToMemviewSlice */
27522  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__float(PyObject *obj, int writable_flag) {
27523  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27524  __Pyx_BufFmt_StackElem stack[1];
27525  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27526  int retcode;
27527  if (obj == Py_None) {
27528  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27529  return result;
27530  }
27531  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27532  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27533  &__Pyx_TypeInfo_float, stack,
27534  &result, obj);
27535  if (unlikely(retcode == -1))
27536  goto __pyx_fail;
27537  return result;
27538 __pyx_fail:
27539  result.memview = NULL;
27540  result.data = NULL;
27541  return result;
27542 }
27543 
27544 /* ObjectToMemviewSlice */
27545  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_double(PyObject *obj, int writable_flag) {
27546  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27547  __Pyx_BufFmt_StackElem stack[1];
27548  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27549  int retcode;
27550  if (obj == Py_None) {
27551  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27552  return result;
27553  }
27554  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27555  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27556  &__Pyx_TypeInfo_double, stack,
27557  &result, obj);
27558  if (unlikely(retcode == -1))
27559  goto __pyx_fail;
27560  return result;
27561 __pyx_fail:
27562  result.memview = NULL;
27563  result.data = NULL;
27564  return result;
27565 }
27566 
27567 /* ObjectToMemviewSlice */
27568  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__double(PyObject *obj, int writable_flag) {
27569  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27570  __Pyx_BufFmt_StackElem stack[1];
27571  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27572  int retcode;
27573  if (obj == Py_None) {
27574  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27575  return result;
27576  }
27577  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27578  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27579  &__Pyx_TypeInfo_double, stack,
27580  &result, obj);
27581  if (unlikely(retcode == -1))
27582  goto __pyx_fail;
27583  return result;
27584 __pyx_fail:
27585  result.memview = NULL;
27586  result.data = NULL;
27587  return result;
27588 }
27589 
27590 /* ObjectToMemviewSlice */
27591  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_d_dc_long__double(PyObject *obj, int writable_flag) {
27592  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27593  __Pyx_BufFmt_StackElem stack[1];
27594  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG) };
27595  int retcode;
27596  if (obj == Py_None) {
27597  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27598  return result;
27599  }
27600  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_C_CONTIG,
27601  (PyBUF_C_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27602  &__Pyx_TypeInfo_long__double, stack,
27603  &result, obj);
27604  if (unlikely(retcode == -1))
27605  goto __pyx_fail;
27606  return result;
27607 __pyx_fail:
27608  result.memview = NULL;
27609  result.data = NULL;
27610  return result;
27611 }
27612 
27613 /* ObjectToMemviewSlice */
27614  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dcd__long__double(PyObject *obj, int writable_flag) {
27615  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27616  __Pyx_BufFmt_StackElem stack[1];
27617  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_CONTIG), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_FOLLOW) };
27618  int retcode;
27619  if (obj == Py_None) {
27620  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27621  return result;
27622  }
27623  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, __Pyx_IS_F_CONTIG,
27624  (PyBUF_F_CONTIGUOUS | PyBUF_FORMAT) | writable_flag, 2,
27625  &__Pyx_TypeInfo_long__double, stack,
27626  &result, obj);
27627  if (unlikely(retcode == -1))
27628  goto __pyx_fail;
27629  return result;
27630 __pyx_fail:
27631  result.memview = NULL;
27632  result.data = NULL;
27633  return result;
27634 }
27635 
27636 /* ObjectToMemviewSlice */
27637  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
27638  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27639  __Pyx_BufFmt_StackElem stack[1];
27640  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27641  int retcode;
27642  if (obj == Py_None) {
27643  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27644  return result;
27645  }
27646  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27647  PyBUF_RECORDS_RO | writable_flag, 1,
27648  &__Pyx_TypeInfo_int, stack,
27649  &result, obj);
27650  if (unlikely(retcode == -1))
27651  goto __pyx_fail;
27652  return result;
27653 __pyx_fail:
27654  result.memview = NULL;
27655  result.data = NULL;
27656  return result;
27657 }
27658 
27659 /* ObjectToMemviewSlice */
27660  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_float(PyObject *obj, int writable_flag) {
27661  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27662  __Pyx_BufFmt_StackElem stack[1];
27663  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27664  int retcode;
27665  if (obj == Py_None) {
27666  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27667  return result;
27668  }
27669  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27670  PyBUF_RECORDS_RO | writable_flag, 1,
27671  &__Pyx_TypeInfo_float, stack,
27672  &result, obj);
27673  if (unlikely(retcode == -1))
27674  goto __pyx_fail;
27675  return result;
27676 __pyx_fail:
27677  result.memview = NULL;
27678  result.data = NULL;
27679  return result;
27680 }
27681 
27682 /* ObjectToMemviewSlice */
27683  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
27684  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27685  __Pyx_BufFmt_StackElem stack[1];
27686  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27687  int retcode;
27688  if (obj == Py_None) {
27689  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27690  return result;
27691  }
27692  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27693  PyBUF_RECORDS_RO | writable_flag, 1,
27694  &__Pyx_TypeInfo_double, stack,
27695  &result, obj);
27696  if (unlikely(retcode == -1))
27697  goto __pyx_fail;
27698  return result;
27699 __pyx_fail:
27700  result.memview = NULL;
27701  result.data = NULL;
27702  return result;
27703 }
27704 
27705 /* ObjectToMemviewSlice */
27706  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_long__double(PyObject *obj, int writable_flag) {
27707  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
27708  __Pyx_BufFmt_StackElem stack[1];
27709  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
27710  int retcode;
27711  if (obj == Py_None) {
27712  result.memview = (struct __pyx_memoryview_obj *) Py_None;
27713  return result;
27714  }
27715  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
27716  PyBUF_RECORDS_RO | writable_flag, 1,
27717  &__Pyx_TypeInfo_long__double, stack,
27718  &result, obj);
27719  if (unlikely(retcode == -1))
27720  goto __pyx_fail;
27721  return result;
27722 __pyx_fail:
27723  result.memview = NULL;
27724  result.data = NULL;
27725  return result;
27726 }
27727 
27728 /* MemviewSliceCopyTemplate */
27729  static __Pyx_memviewslice
27730 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27731  const char *mode, int ndim,
27732  size_t sizeof_dtype, int contig_flag,
27733  int dtype_is_object)
27734 {
27735  __Pyx_RefNannyDeclarations
27736  int i;
27737  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27738  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27739  Py_buffer *buf = &from_memview->view;
27740  PyObject *shape_tuple = NULL;
27741  PyObject *temp_int = NULL;
27742  struct __pyx_array_obj *array_obj = NULL;
27743  struct __pyx_memoryview_obj *memview_obj = NULL;
27744  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27745  for (i = 0; i < ndim; i++) {
27746  if (unlikely(from_mvs->suboffsets[i] >= 0)) {
27747  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27748  "indirect dimensions (axis %d)", i);
27749  goto fail;
27750  }
27751  }
27752  shape_tuple = PyTuple_New(ndim);
27753  if (unlikely(!shape_tuple)) {
27754  goto fail;
27755  }
27756  __Pyx_GOTREF(shape_tuple);
27757  for(i = 0; i < ndim; i++) {
27758  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27759  if(unlikely(!temp_int)) {
27760  goto fail;
27761  } else {
27762  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27763  temp_int = NULL;
27764  }
27765  }
27766  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27767  if (unlikely(!array_obj)) {
27768  goto fail;
27769  }
27770  __Pyx_GOTREF(array_obj);
27771  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27772  (PyObject *) array_obj, contig_flag,
27773  dtype_is_object,
27774  from_mvs->memview->typeinfo);
27775  if (unlikely(!memview_obj))
27776  goto fail;
27777  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27778  goto fail;
27779  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27780  dtype_is_object) < 0))
27781  goto fail;
27782  goto no_fail;
27783 fail:
27784  __Pyx_XDECREF(new_mvs.memview);
27785  new_mvs.memview = NULL;
27786  new_mvs.data = NULL;
27787 no_fail:
27788  __Pyx_XDECREF(shape_tuple);
27789  __Pyx_XDECREF(temp_int);
27790  __Pyx_XDECREF(array_obj);
27791  __Pyx_RefNannyFinishContext();
27792  return new_mvs;
27793 }
27794 
27795 /* CIntToPy */
27796  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27797 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27798 #pragma GCC diagnostic push
27799 #pragma GCC diagnostic ignored "-Wconversion"
27800 #endif
27801  const long neg_one = (long) -1, const_zero = (long) 0;
27802 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27803 #pragma GCC diagnostic pop
27804 #endif
27805  const int is_unsigned = neg_one > const_zero;
27806  if (is_unsigned) {
27807  if (sizeof(long) < sizeof(long)) {
27808  return PyInt_FromLong((long) value);
27809  } else if (sizeof(long) <= sizeof(unsigned long)) {
27810  return PyLong_FromUnsignedLong((unsigned long) value);
27811 #ifdef HAVE_LONG_LONG
27812  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27813  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27814 #endif
27815  }
27816  } else {
27817  if (sizeof(long) <= sizeof(long)) {
27818  return PyInt_FromLong((long) value);
27819 #ifdef HAVE_LONG_LONG
27820  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27821  return PyLong_FromLongLong((PY_LONG_LONG) value);
27822 #endif
27823  }
27824  }
27825  {
27826  int one = 1; int little = (int)*(unsigned char *)&one;
27827  unsigned char *bytes = (unsigned char *)&value;
27828  return _PyLong_FromByteArray(bytes, sizeof(long),
27829  little, !is_unsigned);
27830  }
27831 }
27832 
27833 /* CIntFromPy */
27834  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27835 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27836 #pragma GCC diagnostic push
27837 #pragma GCC diagnostic ignored "-Wconversion"
27838 #endif
27839  const int neg_one = (int) -1, const_zero = (int) 0;
27840 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
27841 #pragma GCC diagnostic pop
27842 #endif
27843  const int is_unsigned = neg_one > const_zero;
27844 #if PY_MAJOR_VERSION < 3
27845  if (likely(PyInt_Check(x))) {
27846  if (sizeof(int) < sizeof(long)) {
27847  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27848  } else {
27849  long val = PyInt_AS_LONG(x);
27850  if (is_unsigned && unlikely(val < 0)) {
27851  goto raise_neg_overflow;
27852  }
27853  return (int) val;
27854  }
27855  } else
27856 #endif
27857  if (likely(PyLong_Check(x))) {
27858  if (is_unsigned) {
27859 #if CYTHON_USE_PYLONG_INTERNALS
27860  const digit* digits = ((PyLongObject*)x)->ob_digit;
27861  switch (Py_SIZE(x)) {
27862  case 0: return (int) 0;
27863  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27864  case 2:
27865  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27866  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27867  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27868  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27869  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27870  }
27871  }
27872  break;
27873  case 3:
27874  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27875  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27876  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27877  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27878  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27879  }
27880  }
27881  break;
27882  case 4:
27883  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27884  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27885  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27886  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27887  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27888  }
27889  }
27890  break;
27891  }
27892 #endif
27893 #if CYTHON_COMPILING_IN_CPYTHON
27894  if (unlikely(Py_SIZE(x) < 0)) {
27895  goto raise_neg_overflow;
27896  }
27897 #else
27898  {
27899  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27900  if (unlikely(result < 0))
27901  return (int) -1;
27902  if (unlikely(result == 1))
27903  goto raise_neg_overflow;
27904  }
27905 #endif
27906  if (sizeof(int) <= sizeof(unsigned long)) {
27907  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27908 #ifdef HAVE_LONG_LONG
27909  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27910  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27911 #endif
27912  }
27913  } else {
27914 #if CYTHON_USE_PYLONG_INTERNALS
27915  const digit* digits = ((PyLongObject*)x)->ob_digit;
27916  switch (Py_SIZE(x)) {
27917  case 0: return (int) 0;
27918  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27919  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27920  case -2:
27921  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27922  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27923  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27924  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27925  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27926  }
27927  }
27928  break;
27929  case 2:
27930  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27931  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27932  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27933  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27934  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27935  }
27936  }
27937  break;
27938  case -3:
27939  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27940  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27941  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27942  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27943  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27944  }
27945  }
27946  break;
27947  case 3:
27948  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27949  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27950  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27951  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27952  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27953  }
27954  }
27955  break;
27956  case -4:
27957  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27958  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27959  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27960  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27961  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27962  }
27963  }
27964  break;
27965  case 4:
27966  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27967  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27968  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27969  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27970  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27971  }
27972  }
27973  break;
27974  }
27975 #endif
27976  if (sizeof(int) <= sizeof(long)) {
27977  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27978 #ifdef HAVE_LONG_LONG
27979  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27980  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27981 #endif
27982  }
27983  }
27984  {
27985 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27986  PyErr_SetString(PyExc_RuntimeError,
27987  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27988 #else
27989  int val;
27990  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27991  #if PY_MAJOR_VERSION < 3
27992  if (likely(v) && !PyLong_Check(v)) {
27993  PyObject *tmp = v;
27994  v = PyNumber_Long(tmp);
27995  Py_DECREF(tmp);
27996  }
27997  #endif
27998  if (likely(v)) {
27999  int one = 1; int is_little = (int)*(unsigned char *)&one;
28000  unsigned char *bytes = (unsigned char *)&val;
28001  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28002  bytes, sizeof(val),
28003  is_little, !is_unsigned);
28004  Py_DECREF(v);
28005  if (likely(!ret))
28006  return val;
28007  }
28008 #endif
28009  return (int) -1;
28010  }
28011  } else {
28012  int val;
28013  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28014  if (!tmp) return (int) -1;
28015  val = __Pyx_PyInt_As_int(tmp);
28016  Py_DECREF(tmp);
28017  return val;
28018  }
28019 raise_overflow:
28020  PyErr_SetString(PyExc_OverflowError,
28021  "value too large to convert to int");
28022  return (int) -1;
28023 raise_neg_overflow:
28024  PyErr_SetString(PyExc_OverflowError,
28025  "can't convert negative value to int");
28026  return (int) -1;
28027 }
28028 
28029 /* CIntFromPy */
28030  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
28031 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28032 #pragma GCC diagnostic push
28033 #pragma GCC diagnostic ignored "-Wconversion"
28034 #endif
28035  const long neg_one = (long) -1, const_zero = (long) 0;
28036 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28037 #pragma GCC diagnostic pop
28038 #endif
28039  const int is_unsigned = neg_one > const_zero;
28040 #if PY_MAJOR_VERSION < 3
28041  if (likely(PyInt_Check(x))) {
28042  if (sizeof(long) < sizeof(long)) {
28043  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
28044  } else {
28045  long val = PyInt_AS_LONG(x);
28046  if (is_unsigned && unlikely(val < 0)) {
28047  goto raise_neg_overflow;
28048  }
28049  return (long) val;
28050  }
28051  } else
28052 #endif
28053  if (likely(PyLong_Check(x))) {
28054  if (is_unsigned) {
28055 #if CYTHON_USE_PYLONG_INTERNALS
28056  const digit* digits = ((PyLongObject*)x)->ob_digit;
28057  switch (Py_SIZE(x)) {
28058  case 0: return (long) 0;
28059  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
28060  case 2:
28061  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28062  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28063  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28064  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
28065  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28066  }
28067  }
28068  break;
28069  case 3:
28070  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28071  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28072  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28073  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
28074  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28075  }
28076  }
28077  break;
28078  case 4:
28079  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28080  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28081  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28082  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
28083  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
28084  }
28085  }
28086  break;
28087  }
28088 #endif
28089 #if CYTHON_COMPILING_IN_CPYTHON
28090  if (unlikely(Py_SIZE(x) < 0)) {
28091  goto raise_neg_overflow;
28092  }
28093 #else
28094  {
28095  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28096  if (unlikely(result < 0))
28097  return (long) -1;
28098  if (unlikely(result == 1))
28099  goto raise_neg_overflow;
28100  }
28101 #endif
28102  if (sizeof(long) <= sizeof(unsigned long)) {
28103  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
28104 #ifdef HAVE_LONG_LONG
28105  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
28106  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28107 #endif
28108  }
28109  } else {
28110 #if CYTHON_USE_PYLONG_INTERNALS
28111  const digit* digits = ((PyLongObject*)x)->ob_digit;
28112  switch (Py_SIZE(x)) {
28113  case 0: return (long) 0;
28114  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
28115  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
28116  case -2:
28117  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
28118  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28119  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28120  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28121  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28122  }
28123  }
28124  break;
28125  case 2:
28126  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
28127  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28128  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28129  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28130  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28131  }
28132  }
28133  break;
28134  case -3:
28135  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
28136  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28137  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28138  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28139  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28140  }
28141  }
28142  break;
28143  case 3:
28144  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
28145  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28146  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28147  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28148  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28149  }
28150  }
28151  break;
28152  case -4:
28153  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
28154  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28155  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28156  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28157  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28158  }
28159  }
28160  break;
28161  case 4:
28162  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
28163  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28164  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28165  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
28166  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
28167  }
28168  }
28169  break;
28170  }
28171 #endif
28172  if (sizeof(long) <= sizeof(long)) {
28173  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
28174 #ifdef HAVE_LONG_LONG
28175  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
28176  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
28177 #endif
28178  }
28179  }
28180  {
28181 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28182  PyErr_SetString(PyExc_RuntimeError,
28183  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28184 #else
28185  long val;
28186  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28187  #if PY_MAJOR_VERSION < 3
28188  if (likely(v) && !PyLong_Check(v)) {
28189  PyObject *tmp = v;
28190  v = PyNumber_Long(tmp);
28191  Py_DECREF(tmp);
28192  }
28193  #endif
28194  if (likely(v)) {
28195  int one = 1; int is_little = (int)*(unsigned char *)&one;
28196  unsigned char *bytes = (unsigned char *)&val;
28197  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28198  bytes, sizeof(val),
28199  is_little, !is_unsigned);
28200  Py_DECREF(v);
28201  if (likely(!ret))
28202  return val;
28203  }
28204 #endif
28205  return (long) -1;
28206  }
28207  } else {
28208  long val;
28209  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28210  if (!tmp) return (long) -1;
28211  val = __Pyx_PyInt_As_long(tmp);
28212  Py_DECREF(tmp);
28213  return val;
28214  }
28215 raise_overflow:
28216  PyErr_SetString(PyExc_OverflowError,
28217  "value too large to convert to long");
28218  return (long) -1;
28219 raise_neg_overflow:
28220  PyErr_SetString(PyExc_OverflowError,
28221  "can't convert negative value to long");
28222  return (long) -1;
28223 }
28224 
28225 /* CIntToPy */
28226  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
28227 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28228 #pragma GCC diagnostic push
28229 #pragma GCC diagnostic ignored "-Wconversion"
28230 #endif
28231  const int neg_one = (int) -1, const_zero = (int) 0;
28232 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28233 #pragma GCC diagnostic pop
28234 #endif
28235  const int is_unsigned = neg_one > const_zero;
28236  if (is_unsigned) {
28237  if (sizeof(int) < sizeof(long)) {
28238  return PyInt_FromLong((long) value);
28239  } else if (sizeof(int) <= sizeof(unsigned long)) {
28240  return PyLong_FromUnsignedLong((unsigned long) value);
28241 #ifdef HAVE_LONG_LONG
28242  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
28243  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
28244 #endif
28245  }
28246  } else {
28247  if (sizeof(int) <= sizeof(long)) {
28248  return PyInt_FromLong((long) value);
28249 #ifdef HAVE_LONG_LONG
28250  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
28251  return PyLong_FromLongLong((PY_LONG_LONG) value);
28252 #endif
28253  }
28254  }
28255  {
28256  int one = 1; int little = (int)*(unsigned char *)&one;
28257  unsigned char *bytes = (unsigned char *)&value;
28258  return _PyLong_FromByteArray(bytes, sizeof(int),
28259  little, !is_unsigned);
28260  }
28261 }
28262 
28263 /* CIntFromPy */
28264  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
28265 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28266 #pragma GCC diagnostic push
28267 #pragma GCC diagnostic ignored "-Wconversion"
28268 #endif
28269  const char neg_one = (char) -1, const_zero = (char) 0;
28270 #ifdef __Pyx_HAS_GCC_DIAGNOSTIC
28271 #pragma GCC diagnostic pop
28272 #endif
28273  const int is_unsigned = neg_one > const_zero;
28274 #if PY_MAJOR_VERSION < 3
28275  if (likely(PyInt_Check(x))) {
28276  if (sizeof(char) < sizeof(long)) {
28277  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
28278  } else {
28279  long val = PyInt_AS_LONG(x);
28280  if (is_unsigned && unlikely(val < 0)) {
28281  goto raise_neg_overflow;
28282  }
28283  return (char) val;
28284  }
28285  } else
28286 #endif
28287  if (likely(PyLong_Check(x))) {
28288  if (is_unsigned) {
28289 #if CYTHON_USE_PYLONG_INTERNALS
28290  const digit* digits = ((PyLongObject*)x)->ob_digit;
28291  switch (Py_SIZE(x)) {
28292  case 0: return (char) 0;
28293  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
28294  case 2:
28295  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28296  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28297  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28298  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
28299  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28300  }
28301  }
28302  break;
28303  case 3:
28304  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28305  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28306  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28307  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
28308  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28309  }
28310  }
28311  break;
28312  case 4:
28313  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28314  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28315  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28316  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
28317  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
28318  }
28319  }
28320  break;
28321  }
28322 #endif
28323 #if CYTHON_COMPILING_IN_CPYTHON
28324  if (unlikely(Py_SIZE(x) < 0)) {
28325  goto raise_neg_overflow;
28326  }
28327 #else
28328  {
28329  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
28330  if (unlikely(result < 0))
28331  return (char) -1;
28332  if (unlikely(result == 1))
28333  goto raise_neg_overflow;
28334  }
28335 #endif
28336  if (sizeof(char) <= sizeof(unsigned long)) {
28337  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
28338 #ifdef HAVE_LONG_LONG
28339  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
28340  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
28341 #endif
28342  }
28343  } else {
28344 #if CYTHON_USE_PYLONG_INTERNALS
28345  const digit* digits = ((PyLongObject*)x)->ob_digit;
28346  switch (Py_SIZE(x)) {
28347  case 0: return (char) 0;
28348  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
28349  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
28350  case -2:
28351  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
28352  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28353  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28354  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28355  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28356  }
28357  }
28358  break;
28359  case 2:
28360  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
28361  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
28362  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28363  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28364  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28365  }
28366  }
28367  break;
28368  case -3:
28369  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
28370  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28371  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28372  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28373  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28374  }
28375  }
28376  break;
28377  case 3:
28378  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
28379  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
28380  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28381  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28382  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28383  }
28384  }
28385  break;
28386  case -4:
28387  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
28388  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28389  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28390  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28391  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28392  }
28393  }
28394  break;
28395  case 4:
28396  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
28397  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
28398  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
28399  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
28400  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
28401  }
28402  }
28403  break;
28404  }
28405 #endif
28406  if (sizeof(char) <= sizeof(long)) {
28407  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
28408 #ifdef HAVE_LONG_LONG
28409  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28410  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28411 #endif
28412  }
28413  }
28414  {
28415 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28416  PyErr_SetString(PyExc_RuntimeError,
28417  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28418 #else
28419  char val;
28420  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28421  #if PY_MAJOR_VERSION < 3
28422  if (likely(v) && !PyLong_Check(v)) {
28423  PyObject *tmp = v;
28424  v = PyNumber_Long(tmp);
28425  Py_DECREF(tmp);
28426  }
28427  #endif
28428  if (likely(v)) {
28429  int one = 1; int is_little = (int)*(unsigned char *)&one;
28430  unsigned char *bytes = (unsigned char *)&val;
28431  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28432  bytes, sizeof(val),
28433  is_little, !is_unsigned);
28434  Py_DECREF(v);
28435  if (likely(!ret))
28436  return val;
28437  }
28438 #endif
28439  return (char) -1;
28440  }
28441  } else {
28442  char val;
28443  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28444  if (!tmp) return (char) -1;
28445  val = __Pyx_PyInt_As_char(tmp);
28446  Py_DECREF(tmp);
28447  return val;
28448  }
28449 raise_overflow:
28450  PyErr_SetString(PyExc_OverflowError,
28451  "value too large to convert to char");
28452  return (char) -1;
28453 raise_neg_overflow:
28454  PyErr_SetString(PyExc_OverflowError,
28455  "can't convert negative value to char");
28456  return (char) -1;
28457 }
28458 
28459 /* CheckBinaryVersion */
28460  static int __Pyx_check_binary_version(void) {
28461  char ctversion[4], rtversion[4];
28462  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28463  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28464  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28465  char message[200];
28466  PyOS_snprintf(message, sizeof(message),
28467  "compiletime version %s of module '%.100s' "
28468  "does not match runtime version %s",
28469  ctversion, __Pyx_MODULE_NAME, rtversion);
28470  return PyErr_WarnEx(NULL, message, 1);
28471  }
28472  return 0;
28473 }
28474 
28475 /* InitStrings */
28476  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28477  while (t->p) {
28478  #if PY_MAJOR_VERSION < 3
28479  if (t->is_unicode) {
28480  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28481  } else if (t->intern) {
28482  *t->p = PyString_InternFromString(t->s);
28483  } else {
28484  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28485  }
28486  #else
28487  if (t->is_unicode | t->is_str) {
28488  if (t->intern) {
28489  *t->p = PyUnicode_InternFromString(t->s);
28490  } else if (t->encoding) {
28491  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28492  } else {
28493  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28494  }
28495  } else {
28496  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28497  }
28498  #endif
28499  if (!*t->p)
28500  return -1;
28501  if (PyObject_Hash(*t->p) == -1)
28502  return -1;
28503  ++t;
28504  }
28505  return 0;
28506 }
28507 
28508 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28509  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28510 }
28511 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28512  Py_ssize_t ignore;
28513  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28514 }
28515 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28516 #if !CYTHON_PEP393_ENABLED
28517 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28518  char* defenc_c;
28519  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28520  if (!defenc) return NULL;
28521  defenc_c = PyBytes_AS_STRING(defenc);
28522 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28523  {
28524  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28525  char* c;
28526  for (c = defenc_c; c < end; c++) {
28527  if ((unsigned char) (*c) >= 128) {
28528  PyUnicode_AsASCIIString(o);
28529  return NULL;
28530  }
28531  }
28532  }
28533 #endif
28534  *length = PyBytes_GET_SIZE(defenc);
28535  return defenc_c;
28536 }
28537 #else
28538 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28539  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28540 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28541  if (likely(PyUnicode_IS_ASCII(o))) {
28542  *length = PyUnicode_GET_LENGTH(o);
28543  return PyUnicode_AsUTF8(o);
28544  } else {
28545  PyUnicode_AsASCIIString(o);
28546  return NULL;
28547  }
28548 #else
28549  return PyUnicode_AsUTF8AndSize(o, length);
28550 #endif
28551 }
28552 #endif
28553 #endif
28554 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28555 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28556  if (
28557 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28558  __Pyx_sys_getdefaultencoding_not_ascii &&
28559 #endif
28560  PyUnicode_Check(o)) {
28561  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28562  } else
28563 #endif
28564 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28565  if (PyByteArray_Check(o)) {
28566  *length = PyByteArray_GET_SIZE(o);
28567  return PyByteArray_AS_STRING(o);
28568  } else
28569 #endif
28570  {
28571  char* result;
28572  int r = PyBytes_AsStringAndSize(o, &result, length);
28573  if (unlikely(r < 0)) {
28574  return NULL;
28575  } else {
28576  return result;
28577  }
28578  }
28579 }
28580 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
28581  int is_true = x == Py_True;
28582  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28583  else return PyObject_IsTrue(x);
28584 }
28585 static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
28586  int retval;
28587  if (unlikely(!x)) return -1;
28588  retval = __Pyx_PyObject_IsTrue(x);
28589  Py_DECREF(x);
28590  return retval;
28591 }
28592 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28593 #if PY_MAJOR_VERSION >= 3
28594  if (PyLong_Check(result)) {
28595  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28596  "__int__ returned non-int (type %.200s). "
28597  "The ability to return an instance of a strict subclass of int "
28598  "is deprecated, and may be removed in a future version of Python.",
28599  Py_TYPE(result)->tp_name)) {
28600  Py_DECREF(result);
28601  return NULL;
28602  }
28603  return result;
28604  }
28605 #endif
28606  PyErr_Format(PyExc_TypeError,
28607  "__%.4s__ returned non-%.4s (type %.200s)",
28608  type_name, type_name, Py_TYPE(result)->tp_name);
28609  Py_DECREF(result);
28610  return NULL;
28611 }
28612 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28613 #if CYTHON_USE_TYPE_SLOTS
28614  PyNumberMethods *m;
28615 #endif
28616  const char *name = NULL;
28617  PyObject *res = NULL;
28618 #if PY_MAJOR_VERSION < 3
28619  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28620 #else
28621  if (likely(PyLong_Check(x)))
28622 #endif
28623  return __Pyx_NewRef(x);
28624 #if CYTHON_USE_TYPE_SLOTS
28625  m = Py_TYPE(x)->tp_as_number;
28626  #if PY_MAJOR_VERSION < 3
28627  if (m && m->nb_int) {
28628  name = "int";
28629  res = m->nb_int(x);
28630  }
28631  else if (m && m->nb_long) {
28632  name = "long";
28633  res = m->nb_long(x);
28634  }
28635  #else
28636  if (likely(m && m->nb_int)) {
28637  name = "int";
28638  res = m->nb_int(x);
28639  }
28640  #endif
28641 #else
28642  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28643  res = PyNumber_Int(x);
28644  }
28645 #endif
28646  if (likely(res)) {
28647 #if PY_MAJOR_VERSION < 3
28648  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28649 #else
28650  if (unlikely(!PyLong_CheckExact(res))) {
28651 #endif
28652  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28653  }
28654  }
28655  else if (!PyErr_Occurred()) {
28656  PyErr_SetString(PyExc_TypeError,
28657  "an integer is required");
28658  }
28659  return res;
28660 }
28661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28662  Py_ssize_t ival;
28663  PyObject *x;
28664 #if PY_MAJOR_VERSION < 3
28665  if (likely(PyInt_CheckExact(b))) {
28666  if (sizeof(Py_ssize_t) >= sizeof(long))
28667  return PyInt_AS_LONG(b);
28668  else
28669  return PyInt_AsSsize_t(b);
28670  }
28671 #endif
28672  if (likely(PyLong_CheckExact(b))) {
28673  #if CYTHON_USE_PYLONG_INTERNALS
28674  const digit* digits = ((PyLongObject*)b)->ob_digit;
28675  const Py_ssize_t size = Py_SIZE(b);
28676  if (likely(__Pyx_sst_abs(size) <= 1)) {
28677  ival = likely(size) ? digits[0] : 0;
28678  if (size == -1) ival = -ival;
28679  return ival;
28680  } else {
28681  switch (size) {
28682  case 2:
28683  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28684  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28685  }
28686  break;
28687  case -2:
28688  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28689  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28690  }
28691  break;
28692  case 3:
28693  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28694  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28695  }
28696  break;
28697  case -3:
28698  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28699  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28700  }
28701  break;
28702  case 4:
28703  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28704  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28705  }
28706  break;
28707  case -4:
28708  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28709  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28710  }
28711  break;
28712  }
28713  }
28714  #endif
28715  return PyLong_AsSsize_t(b);
28716  }
28717  x = PyNumber_Index(b);
28718  if (!x) return -1;
28719  ival = PyInt_AsSsize_t(x);
28720  Py_DECREF(x);
28721  return ival;
28722 }
28723 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28724  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28725 }
28726 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28727  return PyInt_FromSize_t(ival);
28728 }
28729 
28730 
28731 #endif /* Py_PYTHON_H */
Base class for linear operators. This class serves as interface for all derived classes.